This is a migrated thread and some comments may be shown as answers.

User Control in RadWindow causes window to close on postback

1 Answer 105 Views
Window
This is a migrated thread and some comments may be shown as answers.
Christopher
Top achievements
Rank 1
Christopher asked on 05 Jun 2013, 09:00 AM
Hi
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? 

1 Answer, 1 is accepted

Sort by
0
Marin Bratanov
Telerik team
answered on 06 Jun 2013, 12:59 PM
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.


Regards,
Marin Bratanov
Telerik
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.
Tags
Window
Asked by
Christopher
Top achievements
Rank 1
Answers by
Marin Bratanov
Telerik team
Share this question
or