动态装载
来源:互联网 发布:百姓网淘宝网 编辑:程序博客网 时间:2024/04/27 13:01
1: 基类 SkinnedForumWebControl : WebControl, InamingContainer
1) 默认构造函数
public SkinnedForumWebControl() {
// Attempt to get the current user
user = Users.GetLoggedOnUser();
// Is the user not availabe - must be anonymous
if (user == null)
Users.TrackAnonymousUsers();
// Set the siteStyle for the page
if (user != null)
skinName = user.Skin;
else
skinName = Globals.Skin;
// If we have an instance of context, let's attempt to
// get the ForumID so we can save the user from writing
// the code
if (null != Context) {
GetPostIDFromRequest();
GetForumIDFromRequest();
GetForumGroupIDFromRequest();
GetReturnURLFromRequest();
}
}
2) 4个自定义的方法
// Retrieves the PostID,ForumID,ForumGroupID, ReturnUrl from the request querystring/post.
private void GetPostIDFromRequest()
private void GetForumIDFromRequest()
private void ForumGroupID ()
private void GetReturnURLFromRequest ()
3) 重写方法
protected override void CreateChildControls() {
Control skin;
// Load the skin(.ascx) as an object instance
skin = LoadSkin();
// to be overrided , Initialize the control template and populate the control with values
InitializeSkin(skin);
Controls.Add(skin);
}
4) 属性访问器…
2: 继承的类
1) 属性
// Assign a default template name
string skinFilename = "Skin-Login.ascx";
// controls in (.ascx) template
TextBox username;
TextBox password;
Button loginButton;
CheckBox autoLogin;
2) 构造函数
public Login() : base() {
// Assign a default template name
if (SkinFilename == null)
SkinFilename = skinFilename;
}
3) 重写2个基类方法
protected override void CreateChildControls() {
// If the user is already authenticated we have no work to do
if (Page.Request.IsAuthenticated)
return;
base.CreateChildControls();
}
override protected void InitializeSkin(Control skin) {
// Find the login button
loginButton = (Button) skin.FindControl("loginButton");
loginButton.Click += new System.EventHandler(LoginButton_Click);
// add more ……
}
4) 自定义控件方法
- 动态装载
- 动态连接和装载
- 动态装载dll
- 动态分区装载数据
- 装载和动态链接
- 动态库(dll)的静态装载与动态装载
- 19-动态类装载-1
- 动态装载和使用类型
- 动态装载问题的研究
- c#中动态装载dll
- 动态装载js和css
- 保存一下!动态装载js
- 动态装载问题的研究
- 动态装载问题的研究
- 动态装载问题的研究
- java applet 动态装载控件
- 动态装载和使用类型
- 动态装载问题的研究
- 记录页面停留时间
- orcale 的入门知识(有文章上的有自创的)
- 实现千万级数据的分页显示--整理资料并测试(转)
- 使用Digester解析XML文档示例(zz from l_walker)
- 警惕!新版Net Transport(影音传送带)安装有猫腻
- 动态装载
- [原创]jsp实现在线用户列表方法
- 一个加密解密函数 for vb6.0!
- 一个大学教授让人发冷汗的讲演[转帖]
- JSP的9种基本内置组件
- 3D游戏引擎设计与实现(9)
- 自己用的函数
- 也无题
- Linux Shell