Global.asax中事件处理程序的参数 [英] Arguments to Event Handlers in Global.asax

查看:68
本文介绍了Global.asax中事件处理程序的参数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述





有人能指出一些有关对象 EventArgs 参数的信息吗?在 Global.asax 中找到的事件处理程序中。这些参数中是否有任何有用的东西?可以将它们中的任何一个转换为更有用的子类型吗?



我似乎无法在任何地方找到这些事件处理程序的参数。



亲切的愿望,Patrick

Hi,

Can anyone point me at some information about what the object and EventArgs parameters are in the event handlers found in Global.asax. Is anything useful passed in these parameters? Can either of them be cast to a more useful sub-type?

I don''t seem to be able to find anything about the parameters to these event handlers anywhere.

Kind wishes, Patrick

推荐答案

从这里开始:http://msdn.microsoft.com/en-us/library/system.web。 httpapplication.beginrequest(v = vs.100).aspx [ ^ ]



你可以看到这些是事件处理程序,因此他们遵循 c#事件模式 [ ^ ],因此他们有一般性参数。

s ender 将是HttpApplication触发事件 - 这主要是使用。 EventArgs [ ^ ]输入参数我持有基类型的几个后代,但正如我在global.asax中所知,很少使用它。

所以我建议你专注于发送者。
Start here: http://msdn.microsoft.com/en-us/library/system.web.httpapplication.beginrequest(v=vs.100).aspx[^]

As you can see these are event handlers, thus they are following the event pattern of c#[^], thus they have general parameters.
The sender will be the HttpApplication firing the event - this is mostly used. The EventArgs[^] typed parameter my hold several descendants of the base type, but as I know in global.asax it is rarely used.
So I suggest you concentrate on the sender.


这篇关于Global.asax中事件处理程序的参数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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