Tuesday, January 21, 2014

want to save a session variable in httphandler(Use a Variable from HttpHandlers to Other Class)

Inherit a class with

 public class URLRewrite : IHttpModule, IRequiresSessionState

inside BeginRequestEventHandler method (EventHandler)

use as below :

HttpContext.Current.Items["Value"] = HttpContext.Current.Request.Url.AbsoluteUri;

Usage in Other Class
string Value=  (HttpContext.Current.Items["Value"]).ToString();



No comments:

Post a Comment