Solved

Response.Redirect

Posted on 2010-08-16
6
471 Views
Last Modified: 2012-05-10
What Import do I need to access Response.Redirect?
0
Comment
Question by:HLRosenberger
6 Comments
 
LVL 18

Expert Comment

by:Anil Golamari
ID: 33449070
Imports System.IO
0
 
LVL 2

Accepted Solution

by:
larkvale earned 125 total points
ID: 33449211
Assuming you are writing a ASP .NET Web application ?

Your project should reference System.Web

Response.Redirect is found in System.Web.HttpResponse

Although you should not have to Import anything if your Web project is correctly set up

0
 
LVL 22

Assisted Solution

by:Snarf0001
Snarf0001 earned 250 total points
ID: 33449643
Assuming that this is a web app, and that you're trying to redirect from a class file or something that doesn't have the context neatly wrapped in, it's the CURRENT response you need access to, via the HttpContext object:

System.Web.HttpContext.Current.Response.Redirect("xxx");
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 

Assisted Solution

by:dost2010
dost2010 earned 125 total points
ID: 33455208
If you have created a webproject in the visual studio and running under asp.net then you do not need to import anything to execute response.redirect. Your project might have some setting problems, if you are using response.redirect inside the class which is consumed by asp.net application, remove it from there and refactor your code in a way so that response.redirect is in the page code behind and not in the class
0
 
LVL 22

Assisted Solution

by:Snarf0001
Snarf0001 earned 250 total points
ID: 33455533
@dost2010, there's no reason to pull a Response.Redirect out of a class file.

The built in Response.Redirect you have in a Page code-behind is referencing exactly the same object as
System.Web.HttpContext.Current as written above, it's just already wired up for you.
0
 
LVL 1

Author Closing Comment

by:HLRosenberger
ID: 33455740
You are all correct.  This was user error.  Duh, I had created a normal Windows project and not a WEB project.

Thanks
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
WPF - Tooltips for ComboBox items 5 27
Convert to Hour/minute textbox and compare 3 52
LINQ - C# to VB convertion 12 45
Get Client IP on RDS - VB.NET 15 15
If you're writing a .NET application to connect to an Access .mdb database and use pre-existing queries that require parameters, you've come to the right place! Let's say the pre-existing query(qryCust) in Access takes a Date as a parameter and l…
Since .Net 2.0, Visual Basic has made it easy to create a splash screen and set it via the "Splash Screen" drop down in the Project Properties.  A splash screen set in this manner is automatically created, displayed and closed by the framework itsel…
A short film showing how OnPage and Connectwise integration works.
Delivering innovative fully-managed cloud services for mission-critical applications requires expertise in multiple areas plus vision and commitment. Meet a few of the people behind the quality services of Concerto.

929 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

8 Experts available now in Live!

Get 1:1 Help Now