全面了解ScriptManager
EnablePartialRendering ="true|false"
EnableScriptComponents ="true|false"
ID ="ScriptManager1"
OnPageError ="PageError Event Handler"
runat ="server"
>
< ErrorTemplate >
<!-- text and HTML elements -->
< span id ="errorMessageLabel" runat ="server" ></ span >
< input id ="okButton" type ="button" value ="OK" runat ="server" />
</ ErrorTemplate >
< Scripts >
<atlas:ScriptReference
Browser="browser reference"
Path="script file path"
ScriptName="script file name"
/>
</ Scripts >
< Services >
< atlas:ServiceReference
GenerateProxy ="true|false"
Path ="server path name"
Type ="type name"
/>
</ Services >
</ atlas:ScriptManager >
属性名
|
说明
|
EnablePartialRendering
|
是否开启页面局部更新功能,默认值为false
EnablePartialRendering ="true|false"
|
EnableScriptComponents
|
是否启用XML脚本模式,默认值为true
EnableScriptComponents ="true|false"
|
ID
|
控件ID
ID ="ScriptManager1"
|
OnPageError
|
页面错误处理,后面会详细讲到
OnPageError ="PageError Event Handler"
|
runat
|
总是runat="server"
|
< Scripts >
<atlas:ScriptReference ScriptName="AtlasUIDragDrop" />
<atlas:ScriptReference ScriptName="AtlasWebParts" />
<atlas:ScriptReference Path="MyCustom.js" />
</ Scripts >
</ atlas:ScriptManager >
属性
|
描述
|
Path
|
自定义JS脚本的路径
Path ="MyCustom.js"
|
ScriptName
|
指定标准库中的JS脚本名,其中可以指定的有:AtlasUIDragDrop、AtlasUIGlitz、AtlasUIMap、AtlasWebParts
ScriptName ="AtlasUIDragDrop"
|
Browser
|
指定脚本适用的浏览器
|
< Services >
< atlas:ServiceReference Path ="MyWebService.asmx" />
< atlas:ServiceReference Type ="MyWebService" />
</ Services >
</ atlas:ScriptManager >
属性
|
描述
|
Path
|
指定.asmx的路径
< atlas : ServiceReference Path="MyWebService.asmx"/>
|
Type
|
指定Web Service的类型
< atlas : ServiceReference Type="MyWebService"/>
|
GenerateProxy
|
是否生成客户端脚本的代理
GenerateProxy ="true"
|
控件/元素
|
属性
|
说明
|
Button
|
id ="okButton"
runat ="server"
|
用来关闭错误信息
|
<span> 或者<div>
|
id ="errorMessageLabel"
runat ="server"
|
显示错误信息
|
< ErrorTemplate >
< div >
< p >< span id ="errorMessageLabel" runat ="server" ></ span ></ p >
< p >< input id ="okButton" type ="button" value ="OK" runat ="server" /></ p >
</ div >
</ ErrorTemplate >
</ atlas:ScriptManager >
<%@ Page Language="C#" %>
<script runat="server">
protected void Page_ErrorHandler(object sender, PageErrorEventArgs e)
{
e.ErrorMessage = "Exception at " + DateTime.Now.ToString() +
"; Error Message: " + e.Error.Message;
}
protected void ErrorButton_Click(object sender, EventArgs e)
{
throw new Exception("error button clicked");
}
</script>
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
<title>"Atlas" Error Handling</title>
<atlas:ScriptManager ID="ScriptManager1" EnablePartialRendering="true" OnPageError="Page_ErrorHandler"
runat="server">
<ErrorTemplate>
<div style="width: 450px; height: 300px; padding: 10px; border: solid 3px black;
background: #ffd; text-align: left;">
<h1>
Server Error</h1>
<p>
An unhandled exception with the following message has occured on the server:</p>
<p>
<span id="errorMessageLabel" runat="server"></span>
</p>
<p>
<input id="okButton" type="button" value="OK" runat="server" /></p>
</div>
</ErrorTemplate>
</atlas:ScriptManager>
</head>
<body>
<form id="form1" runat="server">
<div>
<h1>
"Atlas" Error Handling</h1>
<p>
This example demonstrates the use of an <code>ErrorTemplate</code> and a <code>PageError</code>
handler, to display a custom error message when an unhandled exception occurs on
the server.</p>
<atlas:UpdatePanel ID="Panel1" Mode="Always" runat="server">
<ContentTemplate>
<p>
Server time:
<%= DateTime.Now.ToString() %>
</p>
<p>
<asp:Button ID="UpdateButton" Text="Update Time" runat="server" />
<asp:Button ID="ErrorButton" Text="Error" OnClick="ErrorButton_Click" runat="server" /></p>
</ContentTemplate>
</atlas:UpdatePanel>
</div>
</form>
</body>
</html>
< Scripts >
<atlas:ScriptReference ScriptName="AtlasUIDragDrop" />
</ Scripts >
</ atlas:ScriptManagerProxy >
谢谢,刚开始学习Atlas:-) 回复
谢谢支持:-)
我好像是在赶时髦,呵呵~~ 回复
并且可能年底会出最终的版本。
我是从 http://blogs.msdn.com/alainler/archive/2006/07/26/678730.aspx看到的。
是值得学习的好东西。 回复
是啊,Atlas的确值得学习一下 回复
:-) 回复
我在content中放proxy,还是会报没有manager的错误。
我将manager放在了master上。
你是怎么用的?
回复
<! DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" >
< html xmlns ="http://www.w3.org/1999/xhtml" >
< head runat ="server" >
< title > Untitled Page </ title >
</ head >
< body >
< form id ="form1" runat ="server" >
< div >
< atlas:ScriptManager ID ="ScriptManager1" runat ="server" >
</ atlas:ScriptManager >
This is the Master Page. < br />
It contains this ScriptManager control: < br />
< br />
< asp:contentplaceholder id ="ContentPlaceHolder1" runat ="server" >
< br />
</ asp:contentplaceholder >
</ div >
</ form >
</ body >
</ html >
< asp:Content ID ="Content1" runat ="server" ContentPlaceHolderID ="ContentPlaceHolder1" >
Hello here is the scriptmanager proxy control < br />
< atlas:ScriptManagerProxy ID ="ScriptManagerProxy1" runat ="server" >
< Scripts >
<atlas:ScriptReference ScriptName="AtlasUIDragDrop" />
</ Scripts >
</ atlas:ScriptManagerProxy >
</ asp:Content >
回复
为啥我的content中的updatepanel总是说找不到manager 回复
# re: Atlas学习手记(2):全面了解ScriptManager 2006-07-26 14:33 sjkehh
全面了解ScriptManager相关推荐
- 服务器标记“asp:ScriptManager”不明确。
转载的哦,解决了我遇到的问题了,好用~~~ 首先说下原先的情况,就是原本老项目的Web解决方案是使用.net framework 2.0的老版本, 所以机器也安装过Microsoft ASP.NET ...
- ScriptManager.RegisterStartupScript方法和Page.ClientScript.RegisterStartupScript() 区别
ScriptManager.RegisterStartupScript方法 如果页面中不用Ajax,cs中运行某段js代码方式可以是: Page.ClientScript.RegisterStartu ...
- ScriptManager 帮助您实现 Web 应用程序的 AJAX 功能
本文讨论: ScriptManager 在 ASP.NET AJAX 中的作用 ScriptManager 的隐式使用和显式使用 ASP.NET AJAX 对 Web 服务的支持 ASP.NET AJ ...
- 通过Ajax来简单的实现局部刷新(主要为C#中使用的UpdatePanel控件和ScriptManager控件)...
1. ScriptManager和UpdatePanel控件联合使用可以实现页面局部异步刷新的效果.UpdatePanel用来设置页面中局部异步刷新的区域,它必须依赖于ScriptManager,因为 ...
- ScriptManager调用 无参数WebService
在工程中添加一个 webservice 使用默认的 红色部分为后添加 为了要让ScriptManager识别这个WEBSERVICE WebService.cs using System; using ...
- 服务器控件的异步请求——UpdatePanel和ScriptManager
aspx文件里面有以下一段代码 <body><form id="form1" runat="server"><div>< ...
- ScriptManager同时存在于两个dll中的问题
错误 44 类型"System.Web.UI.ScriptManager"同时存在于 "c:\WINDOWS\assembly\GAC_MSIL\System.Web.E ...
- 关于scriptManager与JS代码兼容问题
在后台代码中: ScriptManager.RegisterClientScriptBlock(this.Page, this.GetType(), "TimeInvalid", ...
- ScriptManager.RegisterAsyncPostBackControl 方法
来源:VS2012帮助文档 用途: 将控件注册为异步回发的触发器 语法: public void RegisterAsyncPostBackControl(Control control ) 参数 c ...
- Page.ClientScript、ClientScript、ScriptManager、ClientScriptManager等的详细解说
在 .aspx.cs页面中,输入这四个东西:Page.ClientScript.ClientScript.ScriptManager.ClientScriptManager,均会出提示,表示它们均可用 ...
最新文章
- 消防信号二总线有没电压_消防的电源总线和二总线的区别,二总线是不是信号..._消防考试_帮考网...
- 【转】 Android新特性介绍,ConstraintLayout完全解析
- 《javascript高级程序设计》笔记:原型图解
- 波特率_不同波特率CAN总线系统如何进行数据收发
- linux将日期和日历信息追加到文件中_Linux任务调度
- js 树形json转以叶子结点为基准的扁平结构
- 哲学家就餐问题python_Python实现哲学家就餐问题实例代码
- LinuxShell脚本之利用rsync+ssh实现Linux文件系统远程备份
- PostgreSQL最常见问题
- 防刷新ajax视频教程,【赖国荣】Ajax基础与提升第7讲:ajax实现刷新内容实例讲解...
- 黑苹果无线网卡的另一种解决方案
- C++代码字符舞-极乐净土
- 一行代码获取android手机deviceId
- 磁盘的扩展卷和压缩卷显示灰色,无法使用
- python画圆角矩形_js绘制圆角矩形
- 【源码篇】源码阅读集合
- Python初遇问题5.16
- SQL SERVER数据库命名编码规范
- 阿龙的学习笔记---Linux GDB 调试工具(博客转载总结)
- Z字形变换(Java)