3种后台生成前台脚本的方法
来源:互联网 发布:网络协议分层 编辑:程序博客网 时间:2024/05/24 07:29
我们在ASP.NET程序的开发过程中,常常需要向用户给出提示信息,比如是否“操作成功”,“确定”还是“取消”操作。
(1) 点击页面上的按钮,弹出一个对话框提示是“确定”还是“取消”操作,我们采用在按钮中添加属性来完成:
举例如下:
public System.Web.UI.WebControls.Button btnDelRow;
btnDelRow.Attributes.Add("onclick", "return confirm('确定要删吗?');");
(2) 对于页面完成一个操作后,弹出一个对话框提示是否“操作成功”。
举例如下:
Response.Write("<script>alert('删除成功!')</script>");
(3)允许 ASP.NET 服务器控件在 Page 中发出客户端脚本块:
public virtual void RegisterStartupScript(string key,string script);
举例如下:
if(!this.IsStartupScriptRegistered("hello"))
this.RegisterStartupScript("hello","<script>alert('你好!')</script>");
- 3种后台生成前台脚本的方法
- ASP.NET后台代码调用前台javascript脚本的方法
- ASP.NET后台代码调用前台javascript脚本的方法
- ASP.NET后台代码调用前台javascript脚本的方法
- ASP.NET后台代码调用前台javascript脚本的方法
- ASP.NET后台代码调用前台javascript脚本的方法
- 前台访问后台的几种方法
- 后台执行前台脚本
- 后台生成前台表格
- repeater里添加序号的4种方法(前台,后台)
- C#后台调用前台javascript的五种方法
- C#后台调用前台javascript的五种方法
- C#后台调用前台javascript的五种方法
- C#后台调用前台javascript的五种方法
- C#后台调用前台javascript的五种方法
- C#后台调用前台javascript的五种方法
- C#后台调用前台javascript的五种方法
- C#后台调用前台javascript的五种方法
- auto、register、static、extern等存储类修饰符的区别
- 不同页面之间传递值(使用Page.PreviousPage.FindControl)
- ASP.NET MVC 入门1、简介
- 夯实安全管理基础 提高电网运行水平123
- MySQL系统变量interactive_timeout 与 wait_timeout
- 3种后台生成前台脚本的方法
- VC++下编译出极小的程序
- AOP和AspectJ
- jquery 系列 一,简介
- 渐渐成熟的十五种迹象
- ASP.NET MVC 入门2、项目的目录结构与核心的DLL
- Eclispe RCP 异常处理 显示异常对话框
- 对于分页的理解
- 无法向会话状态服务器发出会话状态请求 错误的解决方法