Get current user name and Authentication Type (VB.net) : Authentication « Development « ASP.Net






Get current user name and Authentication Type (VB.net)

<html>
<head>
 <script language="vb" runat="server">
  Sub Page_Load(Src As Object, E As EventArgs)
    lblUser.Text = User.Identity.Name
    lblType.Text = User.Identity.AuthenticationType
  End Sub
 </script>
</head>
<body>
  <font face="Verdana" size="4" color="navy">
  <b>Windows Authentication</b></font><hr>
  <table>
   <tr>
    <td><b>Current Users Name</b></td>
    <td><asp:label id=lblUser runat=server/></td>
   </tr>
   <tr>
    <td><b>Current Authentication Type</b></td>
    <TD><asp:label id=lblType runat=server/></TD>
   </tr>
  </table>
</body>
</html>

           
       








Related examples in the same category

1.Displaying the authentication status in ASP.NET
2.User.Identity.IsAuthenticated (VB.net)
3.User.Identity.Name (VB.net)
4.Context User Identity Name (VB.net)
5.Basic Authentication (C#)
6.Form based login (C#)
7.Form and database based authentication (C#)