惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

V
V2EX
小众软件
小众软件
GbyAI
GbyAI
B
Blog RSS Feed
月光博客
月光博客
A
About on SuperTechFans
Microsoft Security Blog
Microsoft Security Blog
Blog — PlanetScale
Blog — PlanetScale
U
Unit 42
云风的 BLOG
云风的 BLOG
P
Proofpoint News Feed
Recent Announcements
Recent Announcements
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
Vercel News
Vercel News
F
Fortinet All Blogs
Apple Machine Learning Research
Apple Machine Learning Research
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
雷峰网
雷峰网
Google DeepMind News
Google DeepMind News
MongoDB | Blog
MongoDB | Blog
Engineering at Meta
Engineering at Meta
aimingoo的专栏
aimingoo的专栏
博客园_首页
G
Google Developers Blog

博客园 - Tiu

2010走了,又是一年,留个脚印 Commerce Server 2007 随笔一 2009眨眼间过去了,留个纪念 asp.net ajax随笔二 asp.net中慎用static全局变量 收集的关于依赖注入及Unity application block入门的一些资料 2008最后一篇:总结与展望 文件操作类简介 防止页面在提交的过程中多次点击按钮 第一次使用SQLCLR C#网络编程随笔一 装AJAX.NET 1.0的环境,我遇到个问题,进来解答下 关于邮件群发 XML学习一 asp.net窗中的两个Form问题 URL重写入门 动态从数据库中选择Top 个数 关于在数据层返回SqlDataReader 编写类和子程序的几个原则
asp.net ajax随笔一
Tiu · 2009-01-07 · via 博客园 - Tiu

      ScriptManager的主要职责是向浏览器发布脚本,如果使用一个javascript脚本,就可以这样注册一下:

<asp:ScriptManager ID="ScriptManager1" runat="server">
 
<Scripts>
  
<asp:ScriptReference Path="~/scripts/Script1.js" />
  
<asp:ScriptReference Path="~/scripts/Script1.js" />
 
</Scripts>
</asp:ScriptManager>

 另外一个功能是用来注册服务,

<asp:ScriptManager ID="ScriptManager1" runat="server">
 
<Services>
  
<asp:ServiceReference Path="~/Services/MainService.asmx " />
  
</Services>
</asp:ScriptManager>

 还可以进行本地化操作,例如脚本文件是面向法语的可以命名为:SampleScript.fr-FR.js,然后将ScriptManager的EnableScriptLocalization属性设置位True,ScriptManager就会获得对性的脚本文件。

一个页面仅能有一个ScriptManager控件,如果要在一个单独页面单独引入一个js文件可以用ScriptManagerProxy控件。