asp.net.ph

Skip Navigation Links

Default.aspx File

Designing Secure ASP.NET Applications   Forms Authentication Using an XML Users File


The Default.aspx file is the requested, protected resource. It is a simple file that merely displays the string, Hello, plus the recorded e-mail name, and a Signout button.

<%@ Page LANGUAGE = "c#" %>
<html>
<head>
<title>Forms Authentication</title>

<script runat=server>
   private void Page_Load ( Object sender, EventArgs e ) {
      Welcome.InnerHtml = "Hello, " + Context.User.Identity.Name;
   }
   private void Signout_Click ( Object sender, EventArgs E ) {
      FormsAuthentication.SignOut ( );
      Response.Redirect ( "login.aspx" );
   }
</script>

<body>
<h3>Using Forms Authentication</h3>
<span id = "Welcome" runat=server/>
<form runat=server>
   <input type = "submit" onServerClick = "Signout_Click" Value = "Signout" 
      runat = "server" /><p>
</form>
</body>
</html>
See Also

The Forms Authentication Provider



© 2025 Reynald Nuñez and asp.net.ph. All rights reserved.

If you have any question, comment or suggestion
about this site, please send us a note