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
Solved

Response.Redirect

Posted on 2006-11-08
7
454 Views
Last Modified: 2012-08-14
I have a application project that has all .cs files. My main project References to the application. In one of my .cs file I have a method that I want to redirect to another page every time it's called. I did Response.Redirect(""); but it says The type or namespace name 'Response' could not be found (are you missing a using directive or an assembly reference?)
Any clue on where to go from here?
0
Comment
Question by:Karla77
  • 3
  • 3
7 Comments
 
LVL 96

Expert Comment

by:Bob Learned
ID: 17897837
If you are calling this from a class file, then you need:

System.Web.HttpContext.Current.Response

Bob
0
 
LVL 13

Expert Comment

by:jeebukarthikeyan
ID: 17897875
hi,
response.redirect will work only if the page is inherited from  System.Web.UI.Page
i think u have written Response.reditect in a class file

b u d d h a
0
 

Author Comment

by:Karla77
ID: 17898154
If you can't use Response.redirect in a .cs file is there something like Response.redirect that you can use.
0
Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
LVL 96

Expert Comment

by:Bob Learned
ID: 17898190
You can use Response.Redirect in a .cs file, you just need to use what I showed above.

System.Web.HttpContext.Current.Response.Redirect

Bob
0
 

Author Comment

by:Karla77
ID: 17898287
I tried that and I still got The type or namespace name 'HttpContext' does not exist in the class or namespace 'System.Web' (are you missing an assembly reference?)

System.Web.HttpContext.Current.Response.Redirect("");

Is there something else I might have missed?
0
 
LVL 96

Accepted Solution

by:
Bob Learned earned 500 total points
ID: 17898300
Do you have a reference to System.Web.dll in the project?

Bob
0
 

Author Comment

by:Karla77
ID: 17898349
yes I do.
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone 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

I recently went through the process of creating a Calendar Control of events with the basis of using a database to keep track of the dates that are selectable, one requirement was to have the selected date pop-up in a simple lightbox.  At first this…
IntroductionWhile developing web applications, a single page might contain many regions and each region might contain many number of controls with the capability to perform  postback. Many times you might need to perform some action on an ASP.NET po…
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…

790 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