会员
周边
众包
新闻
博问
闪存
赞助商
所有博客
当前博客
我的博客
我的园子
账号设置
简洁模式
...
退出登录
注册
登录
博客园
博客园
首页
新随笔
联系
订阅
管理
Life Cycle
using
System;
using
System.Collections;
using
System.Configuration;
using
System.Data;
using
System.Linq;
using
System.Web;
using
System.Web.Security;
using
System.Web.UI;
using
System.Web.UI.HtmlControls;
using
System.Web.UI.WebControls;
using
System.Web.UI.WebControls.WebParts;
using
System.Xml.Linq;
using
System.Collections.Specialized;
using
System.Diagnostics;
[ToolboxData(
"
<{0}:LifeCycle runat=server></{0}:LifeCycle>
"
)]
public
partial
class
LifeCycle : UserControl, IPostBackEventHandler, IPostBackDataHandler
{
protected
override
void
OnInit(System.EventArgs e)
{
Trace(
"
Lifecycle: Init Event.
"
);
base
.OnInit(e);
}
protected
override
void
TrackViewState()
{
Trace(
"
Lifecycle: Track ViewState.
"
);
base
.TrackViewState();
}
protected
override
void
LoadViewState(
object
savedState)
{
Trace(
"
Lifecycle: Load ViewState Event.
"
);
base
.LoadViewState(savedState);
}
protected
override
void
LoadControlState(
object
savedState)
{
Trace(
"
Lifecycle: Load ControlState Event.
"
);
base
.LoadControlState(savedState);
}
public
override
void
DataBind()
{
Trace(
"
Lifecycle: DataBind Event.
"
);
base
.DataBind();
}
public
bool
LoadPostData(
string
postDataKey, NameValueCollection postCollection)
{
Trace(
"
Lifecycle: Load PostBack Data Event.
"
);
Page.RegisterRequiresRaiseEvent(
this
);
return
true
;
}
protected
override
void
OnLoad(System.EventArgs e)
{
Trace(
"
Lifecycle: Load Event.
"
);
base
.OnLoad(e);
}
public
void
RaisePostDataChangedEvent()
{
Trace(
"
Lifecycle: Post Data Changed Event.
"
);
}
public
void
RaisePostBackEvent(
string
argument)
{
Trace(
"
Lifecycle: PostBack Event.
"
);
}
protected
override
void
OnPreRender(System.EventArgs e)
{
Trace(
"
Lifecycle: PreRender Event.
"
);
Page.RegisterRequiresPostBack(
this
);
base
.OnPreRender(e);
}
protected
override
object
SaveViewState()
{
Trace(
"
Lifecycle: Save ViewState.
"
);
return
base
.SaveViewState();
}
protected
override
object
SaveControlState()
{
Trace(
"
Lifecycle: Save ControlState.
"
);
return
base
.SaveControlState();
}
protected
override
void
Render(HtmlTextWriter writer)
{
base
.Render(writer);
Trace(
"
Lifecycle: Render Event.
"
);
writer.Write(
"
<h3>LifeCycle Control</h3>
"
);
}
protected
override
void
OnUnload(System.EventArgs e)
{
Trace(
"
Lifecycle: Unload Event.
"
);
base
.OnUnload(e);
}
public
override
void
Dispose()
{
Trace(
"
Lifecycle: Dispose Event.
"
);
base
.Dispose();
}
private
void
Trace(
string
info)
{
if
(Context
!=
null
)
{
Context.Trace.Warn(info);
Debug.WriteLine(info);
}
}
}
posted @
2008-06-13 23:36
N/A2011
阅读(
285
) 评论(
0
)
编辑
收藏
举报
会员力量,点亮园子希望
刷新页面
返回顶部
公告