User Control in RadWindow causes window to close on postback

2 posts, 0 answers
  1. Christopher
    Christopher avatar
    1 posts
    Member since:
    Jun 2013

    Posted 05 Jun 2013 Link to this post

    I've got a user control that I've added to a RadWindow, it's an edit page that is opened inside a modal when a row in a grid is clicked instead of redirecting to a new page. To accomplish this in the click event on the row a new User Control is instantiated, data from the row applied to public properties and then the user control is added to the RadWindows list of controls

    It loads fine and but when I click anything that causes postback in the edit page inside of the RadWindow the window disappears and no breakpoints in my code behind is hit. 

    I have confirmed that postback causes the webform to postback and not the user control in the RadWindow.

    Is there any way around this? 
  2. Marin Bratanov
    Marin Bratanov avatar
    5355 posts

    Posted 06 Jun 2013 Link to this post

    Hi Christopher,

    It seems that 
    1) your user control is not recreated after the postback, which is a requirement in ASP, otherwise its instance will be lost and thus no events will be fired. This demo shows an example logic of recreating user controls and this article explains the case in more detail.
    2) you may want to initiate partial postbacks inside the RadWindow and this article explains how to do this. I also advise that you make sure the RadWindow whose ContentTemplate is used for this is kept outside of a RadWindowManager.

    Marin Bratanov
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to the blog feed now.
Back to Top