Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Closing a Web Form After Page Load on ASP.Net
Message
General information
Forum:
ASP.NET
Category:
Other
Miscellaneous
Thread ID:
00758554
Message ID:
00758579
Views:
11
Hi Florencio,

Add the following to your code-behind to render javascript code to the page before it is sent to the client:
StringBuilder sb = new StringBuilder();
sb.Append("<SCRIPT LANGUAGE = \"JavaScript\">");
sb.Append("self.close();");
sb.Append("</SCRIPT>");

if (!Page.IsStartupScriptRegistered("closewindow"))
{
	Page.RegisterStartupScript("closewindow", 
		sb.ToString());
}
>To all,
>
>Is there a Close method that I can use in order to close the current window
>just after the Page Load Event in the Code Behind Page in ASP.Net
>
>Florencio
-----------------------------------------

Cathi Gero, CPA
Prenia Software & Consulting Services
Microsoft C# / .NET MVP
Mere Mortals for .NET MVP
cgero@prenia.com
www.prenia.com
Weblog: blogs.prenia.com/cathi
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform