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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Welcome message error

Status
Not open for further replies.

Everton1Blue

Technical User
Jun 6, 2014
41
GB
Hello

I have a Web page here, but instead of the welcome message greeting the user's email, I have:

strEmailValue_v8qrnn.jpg


strEmailValue is the user's email address (the variable)
strEmail is the email column in my database
strEmailTextBox is the ID of the email form field

What is the reason, please, why I get the variable 'strEmailValue' and not the user's actual email address in the image I have posted?

There are two relevant files, myLogon.aspx.vb and userpage.aspx.vb to which the user is directed after logging on.
In myLogon.aspx.vb, I have:

Code:
Protected Sub LogonBtn_Click(sender As Object, e As EventArgs) Handles LogonBtn.Click

        'Authenticate the user

        Dim Authenticated As Boolean = Authenticate(strEmailTextBox.Text, passwordTextBox.Text)

        'If results found, redirect the user

        If Authenticated Then

            Dim target = String.Format("~/userpage.aspx?strEmailValue={0}", strEmailTextBox.Text)

            Response.Redirect(target, False)

         End If

    End Sub

In userpage.aspx.vb, I have:

Code:
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load

        If Not IsPostBack Then

            Dim strEmailValue As String

            Label2.Text = "Hello " & strEmailValue & ", welcome!"

        End If

        If Not String.IsNullOrEmpty(Request.QueryString("strEmailValue")) Then

            Message = Request.QueryString("strEmailValue")

           End If

         End Sub

What mistake I making, please?

Thank you.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top