Welcome Guest Search | Active Topics | Sign In | Register

Close a dialog from user control Options
Ces@rPil
Posted: Tuesday, March 19, 2013 2:08:11 AM
Rank: Newbie
Groups: Member

Joined: 1/3/2013
Posts: 6
Hi,

I have a dialog that loads a user control in it, I need to close this dialog once I click a button inside my user control. Please advice how I can do this.

Thanks.
eo_support
Posted: Tuesday, March 19, 2013 9:14:03 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,195
Hi,

If the button raises a server side event and the event is not captured by AJAX, then the full page will be reloaded and the dialog will be automatically closed. If the event is captured by AJAX and the dialog is AJAX updated (for example, inside the CallbackPanel, then you will need to set the dialog's InitialState to Hiden in your code.

If the button does not raises a server side event, or the event is captured by AJAX but the dialog is not being AJAX updated, then you can call this method from JavaScript to close the dialog:

http://www.essentialobjects.com/doc/1/jsdoc.public.dialog.close.aspx

Note that none of the case has anything directly to do with whether you have a UserControl or not. However if you need to access the dialog from within your UserControl, then you must somehow expose the dialog control from the hosting page ---- this part is generic ASP.NET programming (how to access a control in parent page from a user control), so it's not covered by our tech support. You can search online for that if that's your case.

Thanks!


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.