Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 298
  • Last Modified:

response.redirect from a class

Hi

Is there a way to call Response.Redirect from a class?

I am getting an error the name 'Response' does not exist in the current context. Is this because I am not calling the response from an aspx page?

Thanks.
0
elmbrook
Asked:
elmbrook
3 Solutions
 
Ramkisan JagtapLead DeveloperCommented:
Please try this one:
System.Web.HttpContext.Current.Response.Redirect(" SomePage.aspx");

Regrds,
Ram
0
 
nmarunCommented:
Try something like:

HttpContext.Current.Response.Redirect("redirectUrl");

Arun
0
 
Dhanasekaran SengodanCommented:
HttpContext.Current.Response.Redirect("SomePage.aspx", true);
0

Featured Post

Ask an Anonymous Question!

Don't feel intimidated by what you don't know. Ask your question anonymously. It's easy! Learn more and upgrade.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now