If you do not run a paragraph of JS code in Ajax,cs, you can:
Page.ClientScript.RegisterStartupScript (Page.gettype (), "", "<script>window.open (' default2.aspx ') </ Script> ");
If Ajax is used in the page, the above code will not work even if executed. In dealing with this situation, we usually use:
Scriptmanager.registerstartupscript (this. Button1, this. GetType (), "Alertscript", "window.open (' default2.aspx ');", true);
The first parameter is the ID of the control to register the script, and try it as long as it's on the page.
The second parameter is the registered script control type, either the control or the GetType () of this, and typeOf (string) is OK.
The third script function name, casually.
The fourth one is the script content.
The fifth is to indicate whether to add the script tag again, if the fourth parameter contains <script></script> label, this is false, otherwise true.
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.