asp.net中Page.ClientScript.RegisterStartupScript用法小结
2016-06-08 16:08
676 查看
//ASP.NET后台页面跳转
Page.ClientScript.RegisterStartupScript(Page.GetType(), "", "<script>if(confirm('保存成功!是否继续添加?')){location.href='ProductonAdd.aspx'}else{location.href='ProductonList.aspx'}</script>");
//后台弹出确定框
ClientScript.RegisterStartupScript(GetType(), "message", "<script>alert('请正确输入!');</script>");
//ASP.NET后台页面跳转
Page.ClientScript.RegisterStartupScript(Page.GetType(), "", "<script>alert('数据添加成功!');{location.href='ProductonList.aspx'}</script>");
或
Page.ClientScript.RegisterStartupScript(typeof(string), "", "<script>window.location.href='AdminMain.aspx';</script>");
//后台弹出文本框
ScriptManager.RegisterStartupScript(Page, typeof(string), "popUp", "window.open('rptView.aspx','打印预览','toolbar=no,location=no,scrollbars=yes,top=200px,left=200px,width=904px,height=650px')",
true);
Page.ClientScript.RegisterStartupScript(Page.GetType(), "", "<script>if(confirm('保存成功!是否继续添加?')){location.href='ProductonAdd.aspx'}else{location.href='ProductonList.aspx'}</script>");
//后台弹出确定框
ClientScript.RegisterStartupScript(GetType(), "message", "<script>alert('请正确输入!');</script>");
//ASP.NET后台页面跳转
Page.ClientScript.RegisterStartupScript(Page.GetType(), "", "<script>alert('数据添加成功!');{location.href='ProductonList.aspx'}</script>");
或
Page.ClientScript.RegisterStartupScript(typeof(string), "", "<script>window.location.href='AdminMain.aspx';</script>");
//后台弹出文本框
ScriptManager.RegisterStartupScript(Page, typeof(string), "popUp", "window.open('rptView.aspx','打印预览','toolbar=no,location=no,scrollbars=yes,top=200px,left=200px,width=904px,height=650px')",
true);
相关文章推荐
- ASP.NET MVC 的分部视图
- ASP.NET MVC 4中如何为不同的浏览器自适应布局和视图
- RaspberryPi cProfile使用
- 建立MVC的依赖项注入 Setting up MVC Dependency Injection 精通ASP-NET-MVC-5-弗瑞曼
- 基于.Net Framework 4.0 Web API开发(5):ASP.NET Web APIs AJAX 跨域请求解决办法(CORS实现)
- spring Aspect 实现自定义注解的日志记录,有时候注解类不起作用的原因分析
- ASP.NET Core 中文文档 第一章 入门
- 2016-6-电商班 Asp.Net MVC4 期末复习要点
- Ajax+Asp.Net无刷新分页
- CasperJS基于PhantomJS抓取页面
- Excel 从ASP.NET 服务器下载到 本地
- Asp中Linq怎么取得表中某列的最大值
- KafkaSpout分析:配置
- Aspose.Cells 设置背景颜色
- visual studio 无法查看aspx源代码
- ASP.NET MVC 5调用其他Action
- Raspberry - 树莓派系统安装
- ASP.NET中,HiddenField隐藏控件的用法
- ASP.NET中,HiddenField隐藏控件的用法
- 【Asp.Net】五大对象