本文介绍了什么是对象发送者,EventArgs e?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; public partial class Search : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { } }
对象发件人有什么用途,EventArgs e 在上面的代码中? 提前谢谢。
What is the use of object sender, EventArgs e in the code above? Thanks in advance.
推荐答案Page_Load 是一个事件处理程序它基本上说明了加载页面时会发生什么。 sender 是导致此事件的原因, e 包含有关该事件的信息。例如,如果你从一定高度掉球, Page_Load is an event handler. It basically tells what should happen if a page is loaded. sender is what caused this event and e contains information about the event. For instance, if you drop a ball from certain height, event: you dropping the ball sender: you e: information about the event. Something like from which height you dropped the ball.
基本上,Page_Load函数是一个事件处理程序。 sender是事件引发对象,e变量是事件参数。请查看以下主题: 处理和提升事件 [ ^ ] [ ^ ] 代表(C#编程指南) [ ^ ] Basicly the Page_Load function is an event handler. The sender is the event raising object, and the e variable is the event arguments. Take a look into the following subjects: Handling and Raising Events[^][^] Delegates (C# Programming Guide)[^]
更多推荐
什么是对象发送者,EventArgs e?
发布评论