httpmodules httphandlers, whats the ideal use of them? when to use and when not to use?

前端 未结 6 920
清酒与你
清酒与你 2021-02-04 13:36

I have some questions about httpmodules and httphandlers, i am a little confused of the real need of them, i created many websites, but rarely used them, sure i lost a benefit f

6条回答
  •  耶瑟儿~
    2021-02-04 14:26

    you could use httpmodules for authentication, auditing or url-rewriting. Since every request first passes through all modules, before it's handled by the httphandler, this is the place to apply code that you want to run before your specific application code.

    You would use an httphandler if you don't want to rely on the asp.net engine. for example you could write your own rendering mechanism based on AJAX, XML and XSLT which does not rely on traditional asp.net pages.

提交回复
热议问题