How do I get a ASPX variable value to AspX.vb Sub?

Discussion in 'ASP.NET 2.0' started by Buzzmaster, Sep 22, 2007.

  1. Typically, you will be handling the event OnAuthenticte to "grab" what the user inputted for the LoginName.
    This would be an example of your login control on the asp page.

    <asp:Login ID="Login1" runat="server" OnAuthenticate="Login1_Authenticate"></asp:Login>

    If you notice, the important thing to take away from this small bit of code is the OnAuthenticate attribute of the asp:Login control.

    In the code behind, or nested in the <script> if you are not using code behinds, you will need to create a method to "Handle" the onAuthenticate event like so;
    C#



     
  2. I used this code and it worked fine. Thanks much.


    strMsg = "UserName = " &amp; User.Identity.Name &amp; vbCrLf
     
  3. How do I get a ASPX variable value to AspX.vb Sub? I a LoginUser control on the page
    and I have a Submit Sub in the aspx.vb code. I want the value of the LoginName1. I've
    tried different methods but nothing I've tried works.

    example strMsg = "UserName = " &amp; LoginName1
     

Share This Page