? 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