// 注册一个名为“Demo”的命名控件
Type.registerNamespace("Demo");
// 定义Demo命名空间下的Message类的构造函数
Demo.Message = function(content, publishTime) {
this._content = content;
this._publishTime = publishTime;
}
// 定义Demo命名空间下的Message类的方法
Demo.Message.prototype = {
getContent: function() {
return this._content;
},
getPublishTime: function() {
return this._publishTime.format("yyyy-MM-dd HH:mm:ss");
},
toString: function() {
return this.getContent() + " " + this.getPublishTime();
}
}
// 在Demo命名空间下注册Message类
Demo.Message.registerClass('Demo.Message');
// 定义在Demo命名空间下的IContent接口(接口不能有构造函数)
Demo.IContent = function() {}
// 定义Demo命名空间下的IContent接口的方法
Demo.IContent.prototype = {
showContent : function() {}
}
// 在Demo命名空间下注册IContent接口
Demo.IContent.registerInterface('Demo.IContent');
// 定义Demo命名空间下的MessageWithUserId类的构造函数
// 我们之后要让这个类继承自Demo.Message
// 在构造函数内用initializeBase调用基类的构造函数
Demo.MessageWithUserId = function(userId, content, publishTime) {
Demo.MessageWithUserId.initializeBase(this, [content, publishTime]);
this._userId = userId;
}
// 定义Demo命名空间下的MessageWithUserId类的方法
Demo.MessageWithUserId.prototype = {
getUserId: function() {
return this._userId;
},
showContent: function() {
return Demo.MessageWithUserId.callBaseMethod(this, 'getContent')
},
// callBaseMethod用于调用基类的方法
toString: function() {
return this.getUserId() + " " + Demo.MessageWithUserId.callBaseMethod(this, 'toString');
}
}
// 在Demo命名空间下注册MessageWithUserId类
// 他继承自Demo.Message类和Demo.IContent接口
Demo.MessageWithUserId.registerClass('Demo.MessageWithUserId', Demo.Message, Demo.IContent);
// 定义在Demo命名空间下的Color枚举(枚举不能有构造函数)
Demo.Color = function() {};
// 定义Demo命名空间下的Color枚举的成员
Demo.Color.prototype =
{
// “0x”代表16进制,eval一下就会变成10进制的整型
Red: 0xFF0000,
Blue: 0x0000FF,
Green: 0x00FF00,
White: 0xFFFFFF
}
// 在Demo命名空间下注册Color枚举
Demo.Color.registerEnum("Demo.Color");
// 只有对异步回发才需要向脚本文件中的 Sys.Application.notifyScriptLoaded 方法添加调用
// 但是建议,对于磁盘提供的脚本文件开发人员可以向此方法添加调用
if (typeof(Sys) !== 'undefined') Sys.Application.notifyScriptLoaded();
没有合适的资源?快使用搜索试试~ 我知道了~
Asp.net2.0中GridView、UpdatePanel等使用示例源码.zip
共28个文件
cs:9个
aspx:7个
dll:2个
1.该资源内容由用户上传,如若侵权请联系客服进行举报
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
版权申诉
0 下载量 144 浏览量
2022-06-18
13:37:12
上传
评论
收藏 860KB ZIP 举报
温馨提示
Asp.net2.0中GridView、UpdatePanel等使用示例源码.zip
资源推荐
资源详情
资源评论
收起资源包目录
Asp.net2.0中GridView、UpdatePanel等使用示例源码.zip (28个子文件)
Asp.net2.0中GridView、UpdatePanel等使用示例源码
AJAX.sln 1KB
Web
App_Code
Practice.cs 1KB
App_Themes
Default
Css.css 1KB
Common.skin 3KB
Web.sitemap 945B
Web.config 7KB
Site.master.cs 411B
Overview
UpdatePanel.aspx 1KB
UpdatePanel.aspx.cs 570B
UpdateProgress.aspx 3KB
Timer.aspx.cs 654B
Sample.aspx 3KB
UpdateProgress.aspx.cs 1007B
Timer.aspx 1KB
Sample.aspx.cs 486B
App_Data
Database.mdf 3.63MB
Database_Log.ldf 504KB
Default.aspx 262B
Default.aspx.cs 479B
Site.master 2KB
ClientScripting
Sample.js 3KB
Sample.aspx 2KB
Sample.aspx.cs 493B
Practice
ShowingTooltipsForGridViewItems.aspx 4KB
ShowingTooltipsForGridViewItems.aspx.cs 941B
Services
Practice.asmx 86B
Bin
System.Web.Extensions.DLL 683KB
System.Web.Extensions.Design.DLL 39KB
共 28 条
- 1
资源评论
programxh
- 粉丝: 17
- 资源: 1万+
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功