ClientScriptManager.RegisterClientScriptInclude 方法

ClientScriptManager.RegisterClientScriptInclude 方法:向Page对象注册客户端脚本包含。

public void RegisterClientScriptInclude (Type type,string key,string url)

参数:
type:要注册的客户端脚本包含的类型。
key:要注册的客户端脚本包含的键。
url:要注册的客户端脚本包含的 URL。
public void Page_Load(Object sender, EventArgs e)
{
    
// 定义页面客户端脚本的名称、URL和类型
    String csname = "ButtonClickScript";
    String csurl 
= "script_include.js";
    Type cstype 
= this.GetType();      

    
//获取当前页面的一个ClientScriptManager类型的引用
    ClientScriptManager cs = Page.ClientScript;

    
// 判断脚本是不是已经注册到了页面中
    if (!cs.IsClientScriptIncludeRegistered(cstype, csname))
    
{
      cs.RegisterClientScriptInclude(cstype, csname, csurl);
    }

}


参见博客文章:http://hi.baidu.com/csharpfather/blog/item/9611c96297626fdde6113a4f.html

本贴子以“现状”提供且没有任何担保,同时也没有授予任何权利
This posting is provided "AS IS" with no warranties, and confers no rights.

posted on 2008-07-05 13:41 心界使者 阅读(52) 评论(0)  编辑 收藏 所属分类: ASP.NETJavascript


标题  
姓名  
主页
Email (博主才能看到) 
验证码 *  看不清,换一张 [登录][注册]
内容(请不要发表任何与政治相关的内容)  
  登录  使用高级评论  新用户注册  返回页首  恢复上次提交      
该文被作者在 2008-07-12 16:54 编辑过


相关链接:
 

导航

统计

公告

一切如来心秘密全身舍利宝箧印陀罗尼咒塔

与我联系

搜索

 

留言簿

随笔分类

文章分类

文章档案

Blogs

资源

积分与排名

最新评论

  • 1. re: 每日一句英语
  • He was knocked into the middle of next week. 他被打的不省人事。 ...
  • --心界使者
  • 2. re: 每日一句英语
  • I'm sorry to hear that. Isn't it serious? 对此我深感不安,不严重吧? ------------------------------------------...
  • --心界使者
  • 3. re: 每日一句英语
  • I have a particular aversion to fishing. 我特别不喜欢钓鱼。 -----------------------------------------------...
  • --心界使者
  • 4. re: 每日一句英语
  • I know what you mean.He really turns me off. 我知道你的意思,他真叫人受不了。 ------------------------------------...
  • --心界使者
  • 5. re: 每日一句英语
  • I have a particular aversion to fishing. 我特别不喜欢钓鱼。 -----------------------------------------------...
  • --心界使者