Server.Transfer Question

Discussion in 'ASP .Net Web Controls' started by Mark A. Deal, Jan 10, 2005.

  1. Mark A. Deal

    Mark A. Deal Guest

    Can anybody explain why the following does not work?

    If Session("ReferredBy") <> "" Then
    Server.Transfer(Session("ReferredBy"))
    Else
    Server.Transfer("Property.aspx")
    End If

    I am trying to open PageA and if a session ID has not been set then it
    re-directs to PageB. When the sessionID has been set then I want to bring
    the user back to PageA

    TIA
    --
    Mark A. Deal
    Document & Data Solutions, LLC
    http://www.docsol.com
    Time Matters AIC
    HotDocs Certified Consultant
    GhostFill Certified Consultant
    Mark A. Deal, Jan 10, 2005
    #1
    1. Advertising

  2. Mark A. Deal

    Saravana Guest

    What is the error you are getting?

    --
    -Saravana
    http://dotnetjunkies.com/WebLog/saravana/
    www.ExtremeExperts.com



    "Mark A. Deal" <> wrote in message
    news:%...
    > Can anybody explain why the following does not work?
    >
    > If Session("ReferredBy") <> "" Then
    > Server.Transfer(Session("ReferredBy"))
    > Else
    > Server.Transfer("Property.aspx")
    > End If
    >
    > I am trying to open PageA and if a session ID has not been set then it
    > re-directs to PageB. When the sessionID has been set then I want to bring
    > the user back to PageA
    >
    > TIA
    > --
    > Mark A. Deal
    > Document & Data Solutions, LLC
    > http://www.docsol.com
    > Time Matters AIC
    > HotDocs Certified Consultant
    > GhostFill Certified Consultant
    >
    >
    Saravana, Jan 10, 2005
    #2
    1. Advertising

  3. Mark A. Deal

    Mark A. Deal Guest

    If Session("ReferredBy") <> "" Then
    Server.Transfer(Session("ReferredBy"))
    Else
    Server.Transfer("Property.aspx")
    End If

    I don't get an error, I just cannot get it to redirect and it is driving me
    nuts! It simply performs a postback to the form where this code is
    contained. Neither of the forms is redirected to.

    Any help is certainly appreciated.

    --
    Mark A. Deal
    Document & Data Solutions, LLC
    http://www.docsol.com
    Time Matters AIC
    HotDocs Certified Consultant
    GhostFill Certified Consultant
    Mark A. Deal, Jan 10, 2005
    #3
  4. Mark A. Deal

    Mythran Guest

    "Mark A. Deal" <> wrote in message
    news:OKP7$...
    > If Session("ReferredBy") <> "" Then
    > Server.Transfer(Session("ReferredBy"))
    > Else
    > Server.Transfer("Property.aspx")
    > End If
    >
    > I don't get an error, I just cannot get it to redirect and it is driving
    > me
    > nuts! It simply performs a postback to the form where this code is
    > contained. Neither of the forms is redirected to.
    >
    > Any help is certainly appreciated.
    >
    > --
    > Mark A. Deal
    > Document & Data Solutions, LLC
    > http://www.docsol.com
    > Time Matters AIC
    > HotDocs Certified Consultant
    > GhostFill Certified Consultant
    >
    >


    What event handler is this code inside of? Please post more code...anywho,
    you might want to check the event handler for a Handles clause.

    Mythran
    Mythran, Jan 11, 2005
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Adrian Bezzina
    Replies:
    0
    Views:
    505
    Adrian Bezzina
    Aug 7, 2003
  2. gh0st54
    Replies:
    6
    Views:
    8,013
    Natty Gur
    Aug 19, 2003
  3. ewolfman
    Replies:
    4
    Views:
    3,342
    ewolfman
    Feb 13, 2006
  4. JT

    Server.Transfer vs. Server.Execute

    JT, Sep 9, 2003, in forum: ASP General
    Replies:
    1
    Views:
    83
    Ray at
    Sep 9, 2003
  5. Jim
    Replies:
    1
    Views:
    838
    Aaron Bertrand - MVP
    Jan 28, 2004
Loading...

Share This Page