1.updatepanel 中弹出提示窗口
ScriptManager.RegisterStartupScript(UpdatePanel1, UpdatePanel1.Page.GetType(), "message", "alert('阿熊!');", true);
2.在新窗口中打开链接
Response.Write(" <script>window.open('NewPage.aspx') </script>");
不过每当弹出这个网页过后,原来的主网页的页面字体自动就变大,因为ASP.NET 中随便使用 Response.Write,会打乱 ASP.NET 的输出流顺序
改进方法:
string js = "<script language=javascript>" + "window.open('NewPage.aspx','newwindow', 'height=600, width=800, top=100, " + "left=100, toolbar=no, menubar=no, scrollbars=no, resizable=yes,location=no, " + "status=no');</script>";
Page.RegisterStartupScript("js", js);
3.页面弹出消息
ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "", "alert('阿熊!')", true);
前面介绍过了如何使用Forms方式进行用户身份验证,然而,在大多网站中都会有一个“退出”功能,让用户可以通出登录。在asp.net中,退出的方式很简单,只要在退出页面中加上代码“FormsAuthentication.SignOut()”即可。
你可以使用Response.Redirect()在退出之 ......
一位ASP.net初学者学习过程中整理的备忘录,包括“打开新的窗口并传送参数,为按钮添加对话框,删除表格选定记录,删除表格记录警告”等等常见问题的解决方法(网上看到挺好的,共享一下)。
1. 打开新的窗口并传送参数:
传送参数:
response.write("<script>window.open
('*.aspx?id="+t ......