Solved

response.redirect from a class

Posted on 2010-08-17
3
250 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

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

Article by: Najam
Having new technologies does not mean they will completely replace old components.  Recently I had to create WCF that will be called by VB6 component.  Here I will describe what steps one should follow while doing so, please feel free to post any qu…
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!
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

707 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now