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?
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");
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With