Advertisement
Guest User

Untitled

a guest
Apr 7th, 2018
144
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.57 KB | None | 0 0
  1. <%@ Page Language="C#" %>
  2. <%@ Import Namespace="System.Data" %>
  3.  
  4. <!DOCTYPE html>
  5.  
  6. <script runat="server">
  7. public void login_Click(object sender, EventArgs e)
  8. {
  9. DataView dataview = (DataView)GageUsers.Select(DataSourceSelectArguments.Empty);
  10. DataTable datatable = dataview.ToTable();
  11.  
  12. if (datatable.Rows.Count < 1)
  13. {
  14. Incorrectlbl.Visible = true;
  15. }
  16. else
  17. {
  18. Response.Redirect("gmail.aspx");
  19. }
  20. }
  21.  
  22. public void Back_Click(object sender, EventArgs e)
  23. {
  24. Response.Redirect("About.aspx");
  25. }
  26.  
  27.  
  28.  
  29. </script>
  30.  
  31. <html xmlns="http://www.w3.org/1999/xhtml">
  32. <head runat="server">
  33. <title>Gmail Sign In</title>
  34. <link rel="shortcut icon" href="images/google.png" />
  35. <style>
  36.  
  37. div.relative {
  38. position: relative;
  39. width: auto;
  40. height: 500px;
  41. background-color: #d9d9d9;
  42. border: 30px solid #f2f2f2;
  43.  
  44. }
  45.  
  46. .signin{
  47. position:absolute;
  48. width:auto;
  49. height:auto;
  50. top:250px;
  51. left:200px;
  52. }
  53. .logo{
  54. position:absolute;
  55. width:auto;
  56. height:auto;
  57. top:100px;
  58. left:200px;
  59. }
  60. .shield{
  61. position:absolute;
  62. width:auto;
  63. height:auto;
  64. top:-200px;
  65. left:600px;
  66. }
  67. </style>
  68. </head>
  69. <body style="background-color:#f2f2f2;">
  70. <form id="form1" runat="server">
  71. <div class="relative">
  72. <div class="logo">
  73. <asp:Image ID="signinlogo" runat="server" ImageUrl="images/googlelogo.png" height="100" Width="300" />
  74.  
  75. </div>
  76. <div class="signin">
  77. <asp:Label ID="usernamelbl" runat="server" Text="Username: " />
  78. <asp:TextBox
  79. id="txtUN"
  80. Runat="server" required="required" />
  81.  
  82. <br />
  83. <br />
  84. <asp:Label ID="Passwordlbl" runat="server" Text="Password: " />
  85. <asp:TextBox
  86. id="txtPWD"
  87. TextMode="Password"
  88. Runat="server" required="required" />
  89. <div class="shield" >"<asp:Image ID="shieldsignin" runat="server" ImageUrl="images/shield.png" height="300" Width="300"/></div>
  90. <br />
  91. <br />
  92. <br />
  93. <br />
  94. <asp:Label ID="Incorrectlbl" runat="server" Text="Username/Password Incorrect. Please Try again." Visible="false" />
  95. <br />
  96. <asp:Button ID="SigninBtn" runat="server" Text="Sign in" OnClick="login_Click" />
  97. <asp:Hyperlink ID="BackBtn" runat="server" href="About.aspx" text="Back" OnClick="Back_Click"/>
  98.  
  99. <div class="DataTesting">
  100. <asp:GridView ID="gvUsers" runat="server"
  101. DataSourceID="GageUsers"
  102. AllowPaging="true"
  103. AllowSorting="true"
  104. />
  105. <asp:SqlDataSource ID="GageUsers" runat="server"
  106.  
  107. SelectCommand="SELECT * FROM GageUsers where (User_ID=@User_ID AND Password=@Password)"
  108. ConnectionString="<%$ ConnectionStrings:team06 %>" >
  109. <SelectParameters>
  110. <asp:ControlParameter ControlID="txtUN"
  111. PropertyName="text" Name="User_ID" />
  112. <asp:ControlParameter ControlID="txtPWD"
  113. PropertyName="text" Name="Password" />
  114. </SelectParameters>
  115. </asp:SqlDataSource>
  116. </div>
  117. </div>
  118. </div>
  119. </form>
  120. </body>
  121. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement