Problem with QueryString?

Discussion in 'ASP.NET / ASP.NET Core' started by Steve, May 21, 2016.

  1. Hello

    When a user logs in he is successfully redirected to my userpage.aspx page, but the 'Hello [email protected]' does not work.

    I have this in my myLogon.aspx.vb file:

    Code:
    ProtectedSub LogonBtn_Click(sender AsObject, e AsEventArgs) Handles LogonBtn.Click
    
    'Retrive the post values and call the authentication method
    
    Dim Authenticated AsBoolean = Authenticate(strEmailTextBox.Text, passwordTextBox.Text)
    
    'If results found then redirect to the userpage.aspx
    
    If Authenticated Then
    
    Dim target = String.Format("~/userpage.aspx?strEmail={0}", strEmailTextBox.Text)
    
    Response.Redirect(target, False)
    
    Else
    
    MsgBox("Sorry, email or password not found")
    
    EndIf
    
    EndSub
    And this in my userpage.aspx.vb file:

    Code:
    ProtectedSub Page_Load(sender AsObject, e As System.EventArgs) HandlesMe.Load
    
    IfNot IsPostBack Then
    
    Dim strEmailValue AsString = "strEmailValue".ToString()
    
    Label2.Text = "Hello " & strEmailValue & ", welcome to my website"
    
    EndIf
    
    IfNotString.IsNullOrEmpty(Request.QueryString("strEmailValue")) Then
    
    Message = Request.QueryString("strEmailValue")
    
    Label1.Text = "Please upload your file"
    
    btnLogout.Visible = True
    
    Else
    
    Label2.Text = "Please login to visit this page"
    
    EndIf
    
    EndSub
    The strEmailValue is the user's email address which ought to appear on my userpage.aspx Web page.

    Thanks for any advice.
     

Share This Page