| 发表于:2007-08-24 17:08:07 楼主 |
就在打开所有页前显示文字就成,我在网上找过了,找的不行呀,代码如下: using system; using system.web; namespace mymodule { public class mymodule : ihttpmodule { public void init(httpapplication application) { application.beginrequest += (new eventhandler(this.application_beginrequest)); application.endrequest += (new eventhandler(this.application_endrequest)); } private void application_beginrequest(object source, eventargs e) { httpapplication application = (httpapplication)source; httpresponse response=application.context.response; response.write( " <h1> beginning of request </h1> <hr> "); } private void application_endrequest(object source, eventargs e) { httpapplication application = (httpapplication)source; httpresponse response=application.context.response; system.web.httpcontext.current.response.write( " <h1> end of request </h1> <hr> "); } public void dispose() { } } } web.config里面也加了 <configuration> <system.web> <httpmodules> <add name= "mymodule " type= "mymodule,mymodule " /> </httpmodules> </system.web> </configuration> 可怎么就是不显示呢??请高手帮忙啊 |
|
|
|
|