事件在asp.net发射了令 [英] Order of events firing off in asp.net

查看:217
本文介绍了事件在asp.net发射了令的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我用GridView的pretty经常和有时我感到困惑的地方把某些code。那是什么事件被解雇了包括所有页面事件的顺序?

编辑

我真的也想了解页和GridView控件之间会发生什么。难道这些事件是否穿越?或者,所有页面事件发生在一次,然后发生的所有事件的GridView?而且不只是GridView的,任何控制 - 但大多是网页和GridView交互


解决方案

 保护无效GridView1_Load(对象发件人,EventArgs的发送)
 {
    System.Diagnostics.Debug.WriteLine(GridView1_Load);
 }
 保护无效GridView1_DataBinding(对象发件人,EventArgs的发送)
 {
    System.Diagnostics.Debug.WriteLine(GridView1_DataBinding);
 }
 保护无效GridView1_DataBound(对象发件人,EventArgs的发送)
 {
    System.Diagnostics.Debug.WriteLine(GridView1_DataBound);
 }
 保护无效GridView1_RowDataBound(对象发件人,GridViewRowEventArgs E)
 {
    System.Diagnostics.Debug.WriteLine(GridView1_RowDataBound);
 }

I use gridviews pretty often and sometimes I get confused to where to put certain code. What is the order that events are fired off including all page events?

Edited

I really am also trying to understand what happens between the page and the Gridview. Do the events ever cross? Or do all page events occur at once then all Gridview events occur? And not just gridviews, any control -- but mostly page and gridview interaction.

解决方案

 protected void GridView1_Load(object sender, EventArgs e)
 {
    System.Diagnostics.Debug.WriteLine("GridView1_Load");
 }
 protected void GridView1_DataBinding(object sender, EventArgs e)
 {
    System.Diagnostics.Debug.WriteLine("GridView1_DataBinding");
 }
 protected void GridView1_DataBound(object sender, EventArgs e)
 {
    System.Diagnostics.Debug.WriteLine("GridView1_DataBound");
 }
 protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
 {
    System.Diagnostics.Debug.WriteLine("GridView1_RowDataBound");
 }

这篇关于事件在asp.net发射了令的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆