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

S

Sal

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
 
S

Sal

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.
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,731
Messages
2,569,432
Members
44,835
Latest member
KetoRushACVBuy

Latest Threads

Top