on page load
StringBuilder sb = new StringBuilder(); sb.Append("<script type = 'text/javascript'>"); sb.Append("window.open('"); sb.Append(url); Session["url"] = url.ToString(); sb.Append("');"); sb.Append("script>"); ClientScript.RegisterStartupScript(this.GetType(), "script", sb.ToString());
after using this the tab is open
but when i want to close the tab after 40 sec then my code is not working
//For closing
* I am also using timer for another work
string jScript = "<script>window.close();script>"; ClientScript.RegisterClientScriptBlock(this.GetType(), "timer1_tick", jScript);
Aditya ChauhanPosted Mar 21, 2015, 2:14 PM
Harpreet SinghPosted Mar 21, 2015, 5:36 AM
Aditya ChauhanPosted Mar 21, 2015, 5:09 AM
Harpreet SinghPosted Mar 21, 2015, 3:39 AM
If you want to know more about this setTimeout function follow the link given below
http://www.w3schools.com/jsref/met_win_settimeout.asp
Joginder BangerPosted Mar 20, 2015, 4:15 PM
first of all make a question in well format, after than any buddy understand what is the problem