设为首页 加入收藏 网站首页
休闲娱乐
军事·社会百态·娱乐八卦·校园
体育·美女写真·幽默笑话·游戏
综合·在线视频·搞笑图片·灵异
两性生活
两性知识·性爱技巧
情色实录·两性图片
女性健康·同性之恋
电脑网络
网络编程·网页制作·软件教学
操作系统·图形图象·冲浪宝典
网络安全·邮件系统·认证考试
热点专题
芙蓉·真人漫画
72式·欲望都市
帅哥·人体彩绘
您现在的位置: 世纪中国 >> 网络编程 >> ASP.NET教学 >> asp.net技巧 >> 教程正文
UpdatePanel和自定义控件中的客户端脚本
作者:中国图霸    教程来源:网络    点击数:    更新时间:2007-1-1
ctually exists.

 

The end result of all of this is that it’s not exactly straight forward to deal with this mismatch and what needs to happen is that a wrapper object needs to be created that can decide which control to use. The wrapper needs to deal with deciding whether MS Ajax is available in the application and if it is, using Reflection to access the ScriptManager to write out any script code.

 

I can’t take credit for this though: Eilon Lipton posted about this issue a while back and his code really was what I needed to get this off the ground, I just wrapped the thing up into a ClientScriptProxy object that I used on a handful of controls. I basically added a handful of the ClientScript methods that I use in my applications. Here’s the class:

 

[*** code updated: 12/12/2006 from comments *** ]

 

/// <summary>

/// This is a proxy object for the Page.ClientScript and MS Ajax ScriptManager

/// object that can operate when MS Ajax is not present. Because MS Ajax

/// may not be available accessing the methods directly is not possible

/// and we are required to indirectly reference client script methods through

/// this class.

///

/// This class should be invoked at the Control's start up and be used

/// to replace all calls Page.ClientScript. Scriptmanager calls are made

/// through Reflection

/// </summary>

public class ClientScriptProxy

{

    private static Type scriptManagerType = null;

 

    // *** Register proxied methods of ScriptManager

    pr

上一页  [1] [2] [3] [4] [5] [6] [7] [8] [9] [10]  ... 下一页  >> 

分类推荐
社会 社会 娱乐 军事 校园
幽默 体育 女性 专题
电脑 编程 网页 软件 系统
安全 图象 冲浪 认证
搞笑 人物 动物 物品 表情
签名 色图 漫画 奇闻
美女 明星 清纯 自拍 欧美
丝袜 卡通 性感 走光
两性 知识 性图 孕育 技巧
同性 单身 情感 实录
视频 写真 搞笑 MTV 翻唱
写实 片段 游戏 综艺
asp.net技巧热门文章
普通教程 ASP.NET里常用的JS
普通教程 UpdatePanel与UrlRewrite
普通教程 .net内存回收与Dispose﹐Close
普通教程 用MasterPage 代替 PageBase
普通教程 DataSet 添加数据集、行、列、
普通教程 ASP.NET组件DataGrid的分页实用
普通教程 使用WebClient自动填写并提交A
普通教程 ASP.NET中水晶报表的使用
普通教程 对NDoc支持.net2.0的异常分析及
普通教程 关于ASP.NET调用javascrip
普通教程 MSBuild, NAnt, NUnit, MSTest
普通教程 asp.net 2.0 上传控件的使用
普通教程 UpdatePanel和自定义控件中的客
普通教程 ASP.NET—From验证:全部代码及
普通教程 自己写的一个asp.net的生成曲线
普通教程 js操作listbox
普通教程 ASP.NET 崩溃-SiteMap中疯狂的
普通教程 ASP.NET 2.0-选用DataSet或Da
普通教程 用.net 处理xmlHttp发送异步请
普通教程 ASP.Net 2.0 图形控件简述

  广东广州海珠区 世纪网络工作室 版权所有 上海电信提供网络带宽
信箱: 9297659@qq.com 粤ICP备06113754号