Click here to Skip to main content
15,909,445 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
How to open ShowModalDialog of Javascript from asp.net code behind (C#).
Posted

I used the below line to open ShowModalDialog of javascript from asp.net code behind.

C#
Page page = HttpContext.Current.CurrentHandler as Page;
                        ScriptManager.RegisterStartupScript(page, page.GetType(), "OpenModalDialog", "<script type=text/javascript>window.showModalDialog('ClockPopUP.aspx', null, 'dialogWidth:290px;dialogHeight:270px;status:no'); </script>", false);
 
Share this answer
 
You will have to use the Page.RegisterStartupScript or the Page.RegisterClientScriptBlock methods. Refer to the links below for more information.

http://msdn.microsoft.com/en-us/library/system.web.ui.page.registerstartupscript.aspx[^]

and/or

http://msdn.microsoft.com/en-us/library/system.web.ui.page.registerclientscriptblock.aspx[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900