Basic Q - Response.Redirect, all redirect to first Response.Redirect statement

Discussion in 'ASP .Net Web Controls' started by Sal, May 15, 2004.

  1. Sal

    Sal Guest

    I have 4 files
    1. login.htm - Username and password box (Start page, links to Auth.aspx
    2. Auth.aspx - checks user against databas
    3. ChangePsswd.aspx - allows user to change pssw
    4. Error.htm - If logon is unsuccessful

    In the Auth.aspx file, I have the following
    Dim validate = (login(in_Username, in_UserPW)) // returns 1 if user in DB. 0 if no

    Select Case validat
    Case
    **Display data*
    Case
    messBox("User does not exist"
    Response.Redirect("Error.htm"
    End Selec

    Elsewhere on the page I have another function redirecting the user to ChangePsswd.aspx to change there password

    Private Sub btnChngPwd_ServerClick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnChngPwd.ServerClic
    Response.Redirect("ChangePasswor.aspx"
    End Su

    However, any time I select the button change password, it always redirects me to the page Error.htm. I have other redirects on the page, but all redirect to the first listed redirect command Response.Redirect("Error.htm") in the select statement. i have tried using both Response.Clear() and Response.End() for all Redirect staements (before and after) but to no avail. Any Ideas much appreciated

    Cheers
     
    Sal, May 15, 2004
    #1
    1. Advertising

  2. Sal

    Sal Guest

    Ok, something I have just tried and seems to be working, is encapsulating all code in the Function
    Private Sub Page_Load(.....

    with

    If Not Page.IsPostBack The
    ....
    End i

    Cheers.
     
    Sal, May 15, 2004
    #2
    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. Charles A. Lackman
    Replies:
    2
    Views:
    8,046
    Charles A. Lackman
    Jan 11, 2006
  2. Jay McGavren
    Replies:
    11
    Views:
    1,158
    Alan Krueger
    Jan 16, 2006
  3. Replies:
    1
    Views:
    845
  4. tconkling

    First statement always evaluated first?

    tconkling, Jul 9, 2005, in forum: C Programming
    Replies:
    3
    Views:
    342
    Keith Thompson
    Jul 9, 2005
  5. lander
    Replies:
    7
    Views:
    350
    lander
    Mar 13, 2008
Loading...

Share This Page