Click here to Skip to main content
15,890,845 members
Please Sign up or sign in to vote.
5.00/5 (1 vote)
See more:
Hi,
I am using a Modal dialog Box in which I placed a submit button
After completing my on that button i want close that modal window.

I tried it with searching google.
But I didn't get result.

Please help me.

Thank You.
Posted
Comments
Supriya Srivastav 4-Feb-12 0:34am    
What are you using for modal dialog,Modalpopupextender or something else?
Jagadeesh Bollabathini 4-Feb-12 1:39am    
I am Using Like This:

Page.ClientScript.RegisterStartupScript(Me.GetType(), "popup", "<script language=javascript>window.showModalDialog('Create_Alerts_Setting.aspx','','width=800px,height=500px')</script>")
Jagadeesh Bollabathini 4-Feb-12 1:38am    
i am using like this

Page.ClientScript.RegisterStartupScript(Me.GetType(), "popup", "<script language=javascript>window.showModalDialog('Create_Alerts_Setting.aspx','','width=800px,height=500px')</script>")

According to google window.close() inside your dialog should work.
 
Share this answer
 
I am assuming for submit you are using a ASP.NET Button and a complete postback in Create_Alerts_Setting.aspx page.

In the Create_Alerts_Setting.aspx page, inside the "head" tag add the following -
HTML
<base target="_self" />


And on the submit button postback
VB
Protected Sub Button1_Click(sender As Object, e As System.EventArgs) Handles Button1.Click
    // something on postback
    ClientScript.RegisterClientScriptBlock(this.GetType(), "closing", "window.close();", True)
End Sub
 
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