| Author: Deepa 01 Aug 2008 | Member Level: Diamond | Rating: Points: 1 |
<html> <head> <title>JavaScript Window Close Example </title> </head> <SCRIPT language="JavaScript1.2"> function popuponclick() { my_window = window.open("", "mywindow","status=1,width=350,height=150"); my_window.document.write('<H1>The Popup Window</H1>'); }
function closepopup() { if(false == my_window.closed) { my_window.close (); } else { alert('Window already closed!'); } } </SCRIPT> <body> <P> <A href="javascript: popuponclick()">Open Popup Window</A> </P> <P> <A href="javascript: closepopup()">Close the Popup Window</A> </P> </body> </html>
|
| Author: Sree Raj 01 Aug 2008 | Member Level: Gold | Rating: Points: 5 |
hi try this code\
Hi, try the below code
string strCode;
strCode = " <script language='javascript' type=text/javascript>" var hdn1 = document.getElementsByName(hdnField');
var savresult=confirm('Do You want to delete all documents and its versions?'); if(savresult==1)
{ //write ur code }
else {
//write Your Code } </script>
ClientScript.RegisterClientScriptBlock(this.GetType(), "onclick()", strCode.ToString(),false);
Regards SreeRaj
|
| Author: G.Hemadribabu 01 Aug 2008 | Member Level: Gold | Rating: Points: 5 |
When you clik a button, it has to ask you 2 question Are you sure you want to exit 1.yes 2. No If you press yes the window gets closed automatically If you select No , then the window remains constantly,
For this,You have to write a small javascript in the buttonclick event like this
The coding shoudl bein response.write()
The command is
Response.Write("<script language='javascript'> { self.close() }</script>")
Hope Thsi will match your requirements perfectly.
|