tags:

views:

5

answers:

1

Hi,

I am trying to pass a value from my HTTP handler module to the redirected response. I am planning to change the view with respect to this 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); // this where am getting the application access mode

Depending on the appAccess, I need to pass a value as response

HttpContext.Current.Response.Cache.SetCacheability(HttpCacheability.NoCache); HttpContext.Current.Response.Cache.SetExpires(DateTime.Now.AddSeconds(-1));

//HTTPModule ends

In the View, with the passed value I need to change the view.

Any idea in passing the value from the HTTP module to view will be helpful.

A: 

Hi all,

I tried this

HttpContext.Current.Items.Add("Mode", "Read");

I am able to set the value in HTTPModule and the same can be accessible from the view. It worked.

Thanks.

Deevin