Solved

Response.Redirect

Posted on 2010-08-16
6
477 Views
Last Modified: 2012-05-10
What Import do I need to access Response.Redirect?
0
Comment
Question by:HLRosenberger
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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 23

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
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

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 23

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

PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

Question has a verified solution.

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

Well, all of us have seen the multiple EXCEL.EXE's in task manager that won't die even if you call the .close, .dispose methods. Try this method to kill any excels in memory. You can copy the kill function to create a check function and replace the …
1.0 - Introduction Converting Visual Basic 6.0 (VB6) to Visual Basic 2008+ (VB.NET). If ever there was a subject full of murkiness and bad decisions, it is this one!   The first problem seems to be that people considering this task of converting…
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.

691 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