Reputation: 1174
I am using following code to redirect user to a page.
Session["USERDATA"] = user;
if (roleName.Equals("Zerker", StringComparison.CurrentCulture))
Response.Redirect("~/Account/Dashboard.aspx");
but this causing the error.
Response is not available in this context.
What should I do?
Upvotes: 15
Views: 34861
Reputation: 10030
I think you are using response object in your own class. This object will not be available there.
Try using
HttpContext.Current.Response.Redirect("~/Account/Dashboard.aspx");
Upvotes: 39