| |||||
Default.aspx FileDesigning 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 AlsoThe Forms Authentication Provider |
| ||||
Check out related books at Amazon
© 2000-2008 Rey Nuñez All rights reserved.
If you have any question, comment or suggestion
about this site, please send us a note
You can help support aspxtreme