1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

? Response.Redirect() from a class in App_Code ?

Discussion in 'C#' started by nubsii, May 19, 2008.

  1. #1
    I have a function in a class in App_Code which I would like to use to send users to another page. Previously this code was located in the code-behind of several aspx pages. VS2005 was refusing to auto-complete my attempts at typing "response.redirect" when I realized the obvious: there is no HttpResponse to work with. How do I get around this? Am I forced to pass a Page to this function to access its HttpResponse?
     
    nubsii, May 19, 2008 IP
  2. dgxshiny

    dgxshiny Greenhorn

    Messages:
    65
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    23
    #2
    HttpContext.Current.Response.Redirect("~/");
     
    dgxshiny, May 20, 2008 IP