Advertisement
Guest User

Untitled

a guest
Feb 27th, 2015
269
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
ASP 0.85 KB | None | 0 0
  1. <%@ Import Namespace="System.Web.Security " %>
  2. <html>
  3.     <head>
  4.     <style type="text/css">
  5.         h3 {
  6.             font-family:Verdana;
  7.         }
  8.         #Msg {
  9.              font-family:Verdana;
  10.              color:red;
  11.         }
  12.     </style>
  13. </head>
  14. <script language="C#" runat="server">
  15.     void Page_Load(Object Src, EventArgs E)
  16.     {
  17.         Welcome.Text = "Hello, " + User.Identity.Name;
  18.     }
  19.     void Signout_Click(Object sender, EventArgs E)
  20.     {
  21.         FormsAuthentication.SignOut();
  22.         Response.Redirect("login.aspx");
  23.     }
  24. </script>
  25.  
  26. <body>
  27.     <h3><font face="Verdana">Using Cookie Authentication</font></h3>
  28.     <form runat="server">
  29.         <h3>
  30.             <asp:Label ID="Welcome" runat="server" /></h3>
  31.         <asp:Button Text="Signout" OnClick="Signout_Click" runat="server" />
  32.     </form>
  33. </body>
  34. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement