Que: What are the ways to intercept a ASP page?
Ans: We can use IHttpModule, IHTTPHandler and IHttpAsyncHandler(for asynch).
Que: What is better a HTTPModule or Global.asax?
Ans: HTTPModule has advantage of getting used by different application, but Global,asax is limited to single app only.But in Global.asax we get advantage of different other events available like Session_Start, Session_End.
Que: What is difference between HTTPHandler and HTTPModule?
Ans:
HTTP handlers
HTTP handlers are the end point objects in ASP.NET pipeline and an HTTP Handler essentially processes the request and produces the response. For example an ASP.NET Page is an HTTP Handler.HTTP handlers are the .NET components that implement the System.Web.IHttpHandler interface. Any class that implements the IHttpHandler interface can act as a target for the incoming HTTP requests.
HTTP Modules
HTTP Modules are objects which also participate the pipeline but they work before and after the HTTP Handler does its job, and produce additional services within the pipeline (for example associating session within a request before HTTP handler executes, and saving the session state after HTTP handler has done its job, is basically done by an HTTP module, SessionStateModule).HTTP modules are .NET components that implement the System.Web.IHttpModule interface. These components plug themselves into the ASP.NET request processing pipeline by registering themselves for certain events. Whenever those events occur, ASP.NET invokes the interested HTTP modules so that the modules can play with the request.
Que: How can we intercept every url request inside a WPF webbrowser?
Ans: There are events available like BeforeNavigate2(inside IWebBrowser2 interface), which can be used to do that.
No comments:
Post a Comment