Controlling postback within ascx control

7 posts, 0 answers
  1. Heath
    Heath avatar
    6 posts
    Member since:
    Feb 2015

    Posted 12 Feb 2015 Link to this post

    I've searched various places but haven't found any answer so I'll throw it out here.

    We have an ascx control with a RadAsyncUpload and RadComboBox. The ComboBox posts back which causes the Upload to lose the files. I've tried using PostbackTrigger property but my issue is the button that should cause the Postback and saving the file is on the parent aspx page. 

    Any clues on how to get this to work properly?
  2. Nencho
    Admin
    Nencho avatar
    1457 posts

    Posted 17 Feb 2015 Link to this post

    Hello,

    I tried to replicate the described  issue at my end, but to no avail. This is why, I am sending you the sample project, I have tested with. Could you give it a try at your end and let us know how your implementation differs from the demonstrated one?

    Regards,
    Nencho
    Telerik
     

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

     
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Heath
    Heath avatar
    6 posts
    Member since:
    Feb 2015

    Posted 18 Feb 2015 in reply to Nencho Link to this post

    Thanks Nencho. After looking at your sample project and then taking a look back at mine I found we had nearly identical pages and the button I was referencing in the PostBackTrigger was on the page not being used. Once I changed the button name it worked fine.
  5. Heath
    Heath avatar
    6 posts
    Member since:
    Feb 2015

    Posted 18 Feb 2015 Link to this post

    Another question now that this issues has been resolved:

    Using the onClientFileUploaded javascript method we are dynamically appending an input field beside each uploaded file to use to enter a description of the file. On postback this input field is lost. Any ideas on how to maintain that input field and the text entered?
  6. Nencho
    Admin
    Nencho avatar
    1457 posts

    Posted 23 Feb 2015 Link to this post

    Hello,

    Could you please elaborate a bit more on your scenario? How do you append those fields? In addition, please provide us with a simplified example of the implementation that you use so we could inspect it locally.

    Regards,
    Nencho
    Telerik
     

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

     
  7. Heath
    Heath avatar
    6 posts
    Member since:
    Feb 2015

    Posted 23 Feb 2015 in reply to Nencho Link to this post

    We are using the example under Application Scenarios: Adding Information to Uploaded Files. Everything works fine until there is a postback by a control that is not listed as a PostBackTrigger. The file is retained but the input and label that were added disappear from the page.

    http://www.telerik.com/help/aspnet-ajax/asyncupload-adding-information.html
  8. Nencho
    Admin
    Nencho avatar
    1457 posts

    Posted 26 Feb 2015 Link to this post

    Hello,

    In order to persist the dynamically added field at client-side, I would suggest you to omit triggering a full postback. In other words, you can ajaxify the RadComboBox. I have implemented this suggestion in the attached sample project.(refer to the UserControl)

    Regards,
    Nencho
    Telerik
     

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

     
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017