RadRating becomes read only and losses style after postback using a Modal popup

2 posts, 0 answers
  1. Young
    Young avatar
    8 posts
    Member since:
    Nov 2012

    Posted 04 Feb 2015 Link to this post

    I have a RadRating on a page that if clicked runs javascript that opens a modal.  The modal pop-up contains a "separate" RadRating module.  Everything work fine until the form on the modal popup is submitted.  This asp:Button-based submission saves to db; generates a postback; and runs javascript that hides the modal.  

    What javascript do I need to use to reload my RadRating after postback from a Foundation 5 reveal modal popup? (more about modal http://foundation.zurb.com/docs/components/reveal.html)


    var prm = Sys.WebForms.PageRequestManager.getInstance();
    prm.add_endRequest(function () {
          // What do I put here to re-initialize the RadRating on the main page? 
    });
  2. Slav
    Admin
    Slav avatar
    1356 posts

    Posted 09 Feb 2015 Link to this post

    Hi Chong,

    Most probably the postback you generate is a partial one, since closing the popup and reloading the RadRating on the page is needed.

    If this is your scenario, you can use a RadAjaxManager control in order to trigger the AJAX request and declare the rating on the page as updated control in the settings of RadAjaxManager, which will result in updating the rating when an AJAX request is initiated.

    To demonstrate this approach, I created a sample that shows how you can use the selection of the rating in the popup to update the rating on the page. I used a RadWindow instance as a popup, nevertheless you can replace it with a popup of your choosing, which will change only the implementation of the showing and closing of the popup.

    I hope this helps. If you are still having difficulties after checking the attached sample, please modify it so that it matches your scenario and send it back. In case this is not possible, you could also describe the changes I need to make to the sample  in order to recreate your case more accurately.

    Regards,
    Slav
    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
Back to Top