Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Input string was not in a correct format

Status
Not open for further replies.

eulogy6

Programmer
Apr 30, 2004
26
Hi all,

:::::In users.aspx page I have the following:

Private Sub Linkbutton4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Linkbutton4.Click

Dim user As String
user = txt2.Text

Dim pass As String
pass = txt3.Text

Session("Username") = user
Session("Password") = pass

Response.Redirect("newpage.aspx")
End Sub

::: In newpage.aspx I have the following:

Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
If Not IsPostBack Then

Dim user As String
Dim pass As String

user = Session("Username")
pass = Session("Password")

If user Or pass = "" Then
Response.Redirect("users.aspx")
End If
End If

End Sub

When I fire the Linkbutton4 I have the error message:
Input string was not in a correct format

You have any idea?

Thanx
 
I havent programmed for web for a long time. So:

-You save strings in session variables. Do the txt2 and txt3 contain text, or one is empty?

-if(user Or pass = ""). Not like this.
if(user = "" orelse pass = "")

I am guessing because it has been time since i last used asp.net.
 
TipGiver thanx for your kind replay,

both txt2 & txt3 contain text

 
try this Response.Redirect("newpage.aspx", false)

BTW this logic would be better placed in either the Global.asax BeginRequest event or use the built in forms authentication module.

Jason Meckley
Programmer
Specialty Bakers, Inc.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top