Mega Code Archive

 
Categories / ASP.Net / Development
 

Basic Authentication (C#)

<%--         <html> <head>   <script language="C#" runat="server">     void Page_Load(Object Src,EventArgs E)     {         lblUser.Text = User.Identity.Name;         lblType.Text = User.Identity.AuthenticationType;     }   </script> </head> <body>     <font face="Verdana" size="4" color="navy">     <b>Windows Authentication</b></font><hr>     <table border=1 bordercolor="#FFFFFF" bgcolor="Silver"      cellspacing=0 cellpadding=4>       <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> --%> <%-- web.config <configuration>   <system.web>     <authentication mode="Windows" />   </system.web> </configuration> --%>