httphandler与httpmodule区别

1、配置不同:

<httpModules>
<!--name表示类名,BtEd2k.UILogic表示命名空间--> <add name="Common" type="BtEd2k.UILogic.Common,BtEd2k.UILogic"></add> </httpModules> <httpHandlers>
  <!--path表示可访问的文件,BtEd2k.UILogic表示命名空间,verb指文件类型如*.aspx,*.ascx-->

<add path="Default.aspx" verb="*" type="BtEd2k.UILogic.Torrent,BtEd2k.UILogic"/> </httpHandlers>

2、用途不同:

a、httphandler相当与webform,可以指定访问哪一个页面的哪一个方法。

b、httpmodule相当于Global,所有的页面都会访问到里面定义的方法。

原文地址:https://www.cnblogs.com/renzaijianghu/p/4102622.html