To pass a value on runtime from HTTPContext as response -


i trying pass value http handler module redirected response. planning change view respect value.

//httpmodule  if (!authorizer.isauthorized(controller, action,  context.user)) { context.response.redirect(authorization_failure_url); }   appaccess appaccess = appauth.getapplicationaccessstatus("app1", context.user.identity.name.tostring(), avlaccessmode, edit);  

// getting application access mode

depending on appaccess, need pass value response

httpcontext.current.response.cache.setcacheability(httpcacheability.nocache);  httpcontext.current.response.cache.setexpires(datetime.now.addseconds(-1)); 

//httpmodule ends

in view, passed value need change view.

any idea in passing value http module view helpful.

i tried this

httpcontext.current.items.add("mode", "read");

i able set value in httpmodule , same can accessible view. worked.

thanks.


Comments

Popular posts from this blog

unicode - Are email addresses allowed to contain non-alphanumeric characters? -

c++ - Convert big endian to little endian when reading from a binary file -

C#: Application without a window or taskbar item (background app) that can still use Console.WriteLine() -