Advertisement
Guest User

Untitled

a guest
Oct 20th, 2012
224
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 3.82 KB | None | 0 0
  1. <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Login.aspx.cs" Inherits="TidyWorkbookWebsite.Login" %>
  2.  
  3. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  4. <html xmlns="http://www.w3.org/1999/xhtml">
  5. <head runat="server">
  6.     <title></title>
  7.     <link rel="stylesheet" href="Content/themes/dot-luv/jquery-ui-1.9.0.custom.min.css" />
  8.     <script src="Scripts/jquery-1.8.2.min.js"></script>
  9.     <script src="Scripts/jquery-ui-1.9.0.min.js"></script>
  10.     <script type="text/javascript">
  11.         function ShowError(error) {
  12.             debugger;
  13.             var errorDiv = $("#errormsg");
  14.             if (errorDiv.length == 0) {
  15.                 $("<div class='ui-state-error formElement' id='errormsg'></div>").prependTo("#loginForm");
  16.                 errorDiv = $("#errormsg");
  17.             }
  18.             errorDiv.html(error);
  19.         }
  20.  
  21.         function ValidateLoginForm() {
  22.             var error = "";
  23.             if ($("#<%=txtUsername.ClientID%>").val() == "")
  24.                 error += "Username cannot be left empty!<br/>";
  25.             if ($("#<%=txtPassword.ClientID%>").val() == "")
  26.                 error += "Password cannot be left empty!<br/>";
  27.             if ($("#<%=txtCompanyAccessKey.ClientID%>").val() == "")
  28.                 error += "Company cannot be left empty!<br/>";
  29.  
  30.             if (error == "") {
  31.                 $("#errormsg").remove();
  32.                 return true;
  33.             } else {
  34.                 ShowError(error);
  35.                 return false;
  36.             }
  37.         }
  38.  
  39.         $(function () {
  40.             $("#loginForm").dialog({
  41.                 autoOpen: true,
  42.                 resizable: false,
  43.                 draggable: false,
  44.                 dialogClass: "basic-dialog",
  45.                 title: "Login",
  46.                 closeOnEscape: false,
  47.                 width: 400
  48.             });
  49.  
  50.             $("#btnLogin").button({
  51.                 icons: {
  52.                     primary: "ui-icon-circle-check"
  53.                 }
  54.             });
  55.         });
  56.  
  57.     </script>
  58.     <style type="text/css">
  59.         .ui-dialog-titlebar-close
  60.         {
  61.             visibility: hidden;
  62.         }
  63.         .formElement
  64.         {
  65.             min-height: 30px;
  66.             margin-bottom: 10px;
  67.         }
  68.        
  69.         .longerFormElement {
  70.             min-height: 45px;
  71.         }
  72.         .formElement .textbox
  73.         {
  74.             height: 100%;
  75.         }
  76.        
  77.         .formElement input,.formElement button {
  78.             float: right;
  79.         }
  80.        
  81.         label
  82.         {
  83.             float: left;
  84.             height: 30px;
  85.         }
  86.     </style>
  87. </head>
  88. <body>
  89.     <form id="form1" runat="server">
  90.     <div id="loginForm" title="Login" runat="server">
  91.         <div class="formElement">
  92.             <asp:Label ID="Label3" runat="server" AssociatedControlID="txtUsername" Text="Username"></asp:Label>
  93.             <asp:TextBox runat="server" ID="txtUsername" CssClass="textbox"></asp:TextBox>
  94.         </div>
  95.         <div class="formElement">
  96.             <asp:Label ID="Label1" runat="server" AssociatedControlID="txtPassword" Text="Password"></asp:Label>
  97.             <asp:TextBox runat="server" ID="txtPassword" TextMode="Password" CssClass="textbox"></asp:TextBox>
  98.         </div>
  99.         <div class="formElement">
  100.             <asp:Label ID="Label2" runat="server" AssociatedControlID="txtCompanyAccessKey" Text="Company"></asp:Label>
  101.             <asp:TextBox runat="server" ID="txtCompanyAccessKey" CssClass="textbox"></asp:TextBox>
  102.         </div>
  103.         <div class="formElement longerFormElement">
  104.             <asp:Button runat="server"  id="btnLogin" Text="Login" OnClick="btnLogin_OnClick" OnClientClick="return ValidateLoginForm();" UseSubmitBehavior="False"/>
  105.         </div>
  106.     </div>
  107.     </form>
  108. </body>
  109. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement