Add Javascript to webpage
function AssignContent()
{
window.open('', '_self', '');
window.close();
}
Add C# code at webpage aspx page.
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
if (!ClientScript.IsClientScriptBlockRegistered("k1"))
{
ClientScript.RegisterClientScriptBlock(this.GetType(), "k1", "<script language='javascript'>AssignContent();</script>");
}
}
}
During form onload the webpage will close.
Closing Webpage Without Prompt
Posted by Unknown at 3/12/2013 02:43:00 pm
Labels: ASP.net C#, Javascript
Subscribe to:
Post Comments (Atom)
0 comments:
Post a Comment