Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Default.aspx File

Default.aspx File

.NET Framework 1.1

The Default.aspx file, shown below, is the default requested, protected resource. It is a simple file that displays the string Hello plus the user's stored e-mail name if a valid cookie is transmitted with the request. If a cookie is not transmitted with the request, ASP.NET automatically redirects the client to the Logon.aspx page. Default.aspx also includes a Signout button that deletes the cookie from the client

<script runat=server>
    private void Page_Load(Object Src, EventArgs e) 
        Welcome.InnerHtml = "Hello, " +   
    private void Signout_Click(Object sender, EventArgs e) 
        Response.Write("Logged out - cookie deleted.");

<h3><font face="Verdana">Forms Authentication Example</font></h3>
<span id="Welcome" runat=server/>
<form runat=server>
    <input type="submit" OnServerClick="Signout_Click" 
           Value="Signout" runat="server"/><p>

See Also

ASP.NET Web Application Security | Forms Authentication Using an XML Users File

© 2015 Microsoft