本文介绍了页面事件没有上升的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我添加了下面显示的事件,但没有一个上升。我想看到上升的顺序。谢谢。
Hi ,
I have added events shown below,but none of the them is rising.I want to see the sequence of rise.Thanks.
private void WebForm1_Init(object sender, EventArgs e)
{
Response.Write("init");
}
private void WebForm1_PreInit(object sender, EventArgs e)
{
Response.Write("preinit");
}
private void WebForm1_PreLoad(object sender, EventArgs e)
{
Response.Write("preload");
}
private void WebForm1_PreRender(object sender, EventArgs e)
{
Response.Write("prerender");
}
private void WebForm1_Unload(object sender, EventArgs e)
{
Response.Write("unload");
}
private void WebForm1_Load(object sender, EventArgs e)
{
Response.Write("formload");
}
private void WebForm1_LoadComplete(object sender, EventArgs e)
{
Response.Write("LoadComplete");
}
推荐答案
private void Page_Init(object sender, EventArgs e)
{
Response.Write("init<br />");
}
private void Page_PreInit(object sender, EventArgs e)
{
Response.Write("preinit<br />");
}
private void Page_PreLoad(object sender, EventArgs e)
{
Response.Write("preload<br />");
}
private void Page_PreRender(object sender, EventArgs e)
{
Response.Write("prerender<br />");
}
// I removed the 'Unload' method because you can't use Response in the 'Unload' method
private void Page_Load(object sender, EventArgs e)
{
Response.Write("formload<br />");
}
private void Page_LoadComplete(object sender, EventArgs e)
{
Response.Write("LoadComplete<br />");
}
希望这有帮助。
Hope this helps.
这篇关于页面事件没有上升的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!