Solved

response.redirect from a class

Posted on 2010-08-17
3
280 Views
Last Modified: 2012-06-27
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
Comment
Question by:elmbrook
3 Comments
 
LVL 12

Accepted Solution

by:
Ramkisan Jagtap earned 200 total points
ID: 33461555
Please try this one:
System.Web.HttpContext.Current.Response.Redirect(" SomePage.aspx");

Regrds,
Ram
0
 
LVL 27

Assisted Solution

by:nmarun
nmarun earned 150 total points
ID: 33461596
Try something like:

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

Arun
0
 
LVL 14

Assisted Solution

by:Dhanasekaran Sengodan
Dhanasekaran Sengodan earned 150 total points
ID: 33463163
HttpContext.Current.Response.Redirect("SomePage.aspx", true);
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Why does my excel data start at B1 instead of A1. 9 91
Graphics 2 32
C# LINQ ForEach() question 6 54
how to double quote a string for an inline sql statement. 8 73
This article describes a simple method to resize a control at runtime.  It includes ready-to-use source code and a complete sample demonstration application.  We'll also talk about C# Extension Methods. Introduction In one of my applications…
Entity Framework is a powerful tool to help you interact with the DataBase but still doesn't help much when we have a Stored Procedure that returns more than one resultset. The solution takes some of out-of-the-box thinking; read on!
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

856 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question