How to close a form after some server side action is finished.
-
Hi, I need to close the form in ASP.net C# on clicking the submit button of my form after the records are saved. Help me out plz....... Dev
If you do, the user will be asked if they want to close the form. Why do you need to do that ?
Christian Graus Driven to the arms of OSX by Vista.
-
If you do, the user will be asked if they want to close the form. Why do you need to do that ?
Christian Graus Driven to the arms of OSX by Vista.
It is required as i m opening this form using window.open alongwith my main form to save partner record and on its close button i hav applied some javascript fucntion so that it could be get on main page. But in case it closed directly from window's close(X) then that function is not executed and some other reasons also forced me to get it close on Submit button's click aftr records are saved. So if you can help me out , i wud b really thankful to you.
-
Hi, By adding clientscript at the serverside,you can close the page .... ie; by using ClientScript.RegisterClientScriptBlock() you can achieve this...
-
It is required as i m opening this form using window.open alongwith my main form to save partner record and on its close button i hav applied some javascript fucntion so that it could be get on main page. But in case it closed directly from window's close(X) then that function is not executed and some other reasons also forced me to get it close on Submit button's click aftr records are saved. So if you can help me out , i wud b really thankful to you.
OK, in that case, do what the other guy said. The event that does the save, inserts the script to close the form into the page, so it closes on reload.
Christian Graus Driven to the arms of OSX by Vista.
-
How can you be working on a presumably paid project, which has requirements, but not know how to use google, or know about the basics of ASP.NET ?
Christian Graus Driven to the arms of OSX by Vista.
-
hi, The function will work like this: syntax: ClientScript.RegisterClientScriptBlock( Me.GetType(), "Ur ScriptName", "Ur javascript code for closing page ")
-
Hi, I need to close the form in ASP.net C# on clicking the submit button of my form after the records are saved. Help me out plz....... Dev
hi, The function will work like this: syntax: ClientScript.RegisterClientScriptBlock( Me.GetType(), "Ur ScriptName", "<script>Ur javascript code for closing page </script>")
-
OK, in that case, do what the other guy said. The event that does the save, inserts the script to close the form into the page, so it closes on reload.
Christian Graus Driven to the arms of OSX by Vista.
-
Hi, I need to close the form in ASP.net C# on clicking the submit button of my form after the records are saved. Help me out plz....... Dev
use javascript on that button click to close that form.
-
use javascript on that button click to close that form.
plz refer the foll code of default.aspx page:- <%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head runat="server"> <title>Untitled Page</title> <script language="javascript"> function hi() { window.close(); } </script> </head> <body> <form id="form1" runat="server"> <asp:ScriptManager ID="ScriptManager1" runat="server" /> <div> <asp:Button ID="Button1" runat="server" OnClientClick="javascript:hi()" Text="Submit" /></div> </form> </body> </html>