Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Login.aspx.cs" Inherits="TidyWorkbookWebsite.Login" %>
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
- <html xmlns="http://www.w3.org/1999/xhtml">
- <head runat="server">
- <title></title>
- <link rel="stylesheet" href="Content/themes/dot-luv/jquery-ui-1.9.0.custom.min.css" />
- <script src="Scripts/jquery-1.8.2.min.js"></script>
- <script src="Scripts/jquery-ui-1.9.0.min.js"></script>
- <script type="text/javascript">
- function ShowError(error) {
- debugger;
- var errorDiv = $("#errormsg");
- if (errorDiv.length == 0) {
- $("<div class='ui-state-error formElement' id='errormsg'></div>").prependTo("#loginForm");
- errorDiv = $("#errormsg");
- }
- errorDiv.html(error);
- }
- function ValidateLoginForm() {
- var error = "";
- if ($("#<%=txtUsername.ClientID%>").val() == "")
- error += "Username cannot be left empty!<br/>";
- if ($("#<%=txtPassword.ClientID%>").val() == "")
- error += "Password cannot be left empty!<br/>";
- if ($("#<%=txtCompanyAccessKey.ClientID%>").val() == "")
- error += "Company cannot be left empty!<br/>";
- if (error == "") {
- $("#errormsg").remove();
- return true;
- } else {
- ShowError(error);
- return false;
- }
- }
- $(function () {
- $("#loginForm").dialog({
- autoOpen: true,
- resizable: false,
- draggable: false,
- dialogClass: "basic-dialog",
- title: "Login",
- closeOnEscape: false,
- width: 400
- });
- $("#btnLogin").button({
- icons: {
- primary: "ui-icon-circle-check"
- }
- });
- });
- </script>
- <style type="text/css">
- .ui-dialog-titlebar-close
- {
- visibility: hidden;
- }
- .formElement
- {
- min-height: 30px;
- margin-bottom: 10px;
- }
- .longerFormElement {
- min-height: 45px;
- }
- .formElement .textbox
- {
- height: 100%;
- }
- .formElement input,.formElement button {
- float: right;
- }
- label
- {
- float: left;
- height: 30px;
- }
- </style>
- </head>
- <body>
- <form id="form1" runat="server">
- <div id="loginForm" title="Login" runat="server">
- <div class="formElement">
- <asp:Label ID="Label3" runat="server" AssociatedControlID="txtUsername" Text="Username"></asp:Label>
- <asp:TextBox runat="server" ID="txtUsername" CssClass="textbox"></asp:TextBox>
- </div>
- <div class="formElement">
- <asp:Label ID="Label1" runat="server" AssociatedControlID="txtPassword" Text="Password"></asp:Label>
- <asp:TextBox runat="server" ID="txtPassword" TextMode="Password" CssClass="textbox"></asp:TextBox>
- </div>
- <div class="formElement">
- <asp:Label ID="Label2" runat="server" AssociatedControlID="txtCompanyAccessKey" Text="Company"></asp:Label>
- <asp:TextBox runat="server" ID="txtCompanyAccessKey" CssClass="textbox"></asp:TextBox>
- </div>
- <div class="formElement longerFormElement">
- <asp:Button runat="server" id="btnLogin" Text="Login" OnClick="btnLogin_OnClick" OnClientClick="return ValidateLoginForm();" UseSubmitBehavior="False"/>
- </div>
- </div>
- </form>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement