Professional Documents
Culture Documents
Login Design
Login Design
Design
<%@ Page Title="" Language="C#" MasterPageFile="~/MasterPage.master"
AutoEventWireup="true" CodeFile="login.aspx.cs" Inherits="login" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
<center><table style="width: 230px">
<tr><td height="20" colspan="2" align="center"><asp:Label ID="Label1" ForeColor ="red"
runat="server" Text="" Visible ="false"></asp:Label></td></tr>
<tr><td align="right"><asp:Label ID="Label2" runat="server" Font-Bold="True"
Style="position: static" Width="97px">Login Name :</asp:Label></td>
<td> <asp:TextBox
ID="txt_id" runat="server" Style="position: static" TabIndex="1" Width="145px"
Height="25px"/>
<asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server"
ControlToValidate="txt_id" ErrorMessage="*"></asp:RequiredFieldValidator></td></tr>
<tr><td align="right" class="style2"><asp:Label ID="Label4"
runat="server">Password :</asp:Label></td>
<td class="style3"> <asp:TextBox
ID="txt_pwd" runat="server" TextMode="Password" TabIndex="2" Width="145px"
Height="25px"/>
<asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server"
ControlToValidate="txt_pwd" ErrorMessage="*"></asp:RequiredFieldValidator></td></tr>
<tr>
<td align="right" class="style1">
<asp:Label ID="Label3" runat="server" Text="User Type :"></asp:Label></td>
<td class="style1">
<asp:DropDownList ID="DropDownList1" runat="server" Width="145px"
Height="25px">
<asp:ListItem>---Select---</asp:ListItem>
<asp:ListItem>User</asp:ListItem>
<asp:ListItem>Admin</asp:ListItem>
<asp:ListItem>Teacher</asp:ListItem>
</asp:DropDownList>
</td>
</tr>
Backed Code
using
using
using
using
using
using
using
using
System;
System.Collections.Generic;
System.Linq;
System.Web;
System.Web.UI;
System.Web.UI.WebControls;
System.Data;
System.Data.SqlClient;
{
Session["username"] = st1;
Session["ctime"] = DateTime.Now.ToShortTimeString();
Response.Redirect("StudentProfile.aspx");
"Admin")
}
else if (st1 == dr["emaiid"].ToString() && st2 == dr["password"].ToString() && st3 ==
{
Response.Redirect("userlist.aspx");
}
else if (st1 == dr["emaiid"].ToString() && st2 == dr["password"].ToString() && st3 ==
"Teacher")
{
Session["username"] = st1;
Response.Redirect("teacherProfile.aspx");
}
else
{
ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "alertMessage",
"alert('Check User Name and Password and contact for admin for approval')", true);
}
}
con.close_connection();
}
}
Register
Design
<%@ Page Title="" Language="C#" MasterPageFile="~/Admin.master" AutoEventWireup="true"
CodeFile="register.aspx.cs" Inherits="register" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
<style type="text/css">
.style1
{
width: 229px;
}
</style>
<script type="text/javascript" src="js/calendar.js"></script>
<script type="text/JavaScript" src="js/scw.js"></script>
<link href="Styles/calendar.css" rel="stylesheet" type="text/css" media="screen" />
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
<center>
<h1>Register Student </h1>
<hr />
<table id="Table2" align="center"
style=" padding: 011px; height: 476px;">
<tr>
<td align="right">
<asp:Label ID="Label17" runat="server" Text="User ID :"
ForeColor="Black"></asp:Label></td>
<td class="style1">
<asp:TextBox ID="txtID" runat="server" Width="145"
ReadOnly="true"></asp:TextBox></td>
<td align="center" colspan="3" height="25">
<asp:Label ID="Label9" runat="server" Font-Bold="True" ForeColor="Red"
Visible="False"></asp:Label></td>
</tr>
<tr style="color: #000000">
<td align="right" height="25">
<asp:Label ID="Label19" runat="server" Text="Email ID :"></asp:Label>
</td>
<td class="style1" >
<asp:TextBox ID="txtEmail"
runat="server" Width="145px" ></asp:TextBox>
</td>
<td align="right" style="width: 147px">
<asp:Label ID="Label20" runat="server" Text="Confirm Email ID :"></asp:Label>
</td>
<td>
<asp:TextBox ID="txtcEmail" runat="server" Width="145px"></asp:TextBox>
<asp:CompareValidator ID="CompareValidator2" runat="server"
ControlToCompare="txtEmail" ControlToValidate="txtcEmail"
ErrorMessage="Email ID not Matched"></asp:CompareValidator>
</td>
</tr>
<tr style="color: #000000">
<td align="right" height="25">
<asp:Label ID="Label1" runat="server" Text="First Name :"></asp:Label></td>
<td class="style1">
<span style="font-size: 7pt; color: #ff0000"> </span><asp:TextBox
ID="txtFname"
runat="server" ReadOnly="false" Width="145px"></asp:TextBox>
</td>
<td align="right" style="width: 147px">
<asp:Label ID="Label15" runat="server" Text="Last Name :" ></asp:Label>
</td>
<td>
<asp:TextBox ID="txtLName"
runat="server" ReadOnly="false" Width="145px" maxlength="25"></asp:TextBox>
</td>
</tr>
<tr style="color: #000000">
<td align="right">
<asp:Label ID="Label16" runat="server" Text="Gender :"
ForeColor="Black"></asp:Label></td>
<td class="style1">
<asp:RadioButtonList ID="radGen" runat="server" ForeColor="Black">
<asp:ListItem Text="Male" Value="male"></asp:ListItem>
<asp:ListItem Text="Female" Value="female"></asp:ListItem>
</asp:RadioButtonList>
</td>
</tr>
<tr style="color: #000000">
<td align="right" height="25">
<asp:Label ID="Label2" runat="server" Text="Password :"></asp:Label></td>
<td class="style1" >
<asp:TextBox
ID="txtPass" runat="server" MaxLength="15" TabIndex="1" TextMode="Password"
Width="145px"></asp:TextBox>
</td>
<td align="right" style="width: 147px">
<asp:Label ID="Label14" runat="server" Text="Confirm Password :"></asp:Label>
</td>
<td>
<asp:TextBox ID="txtcPass" runat="server" MaxLength="15" TabIndex="1"
TextMode="Password"
Width="145px"></asp:TextBox>
</tr>
</td>
<tr>
<td align="right" height="25">
<asp:Label ID="Label13" runat="server" ForeColor="Black" Text="Date Of
Birth :"></asp:Label>
</td>
<td class="style1">
<asp:TextBox ID="TextBox1" onClick="scwShow(this,event)"
runat="server"></asp:TextBox>
</td>
</tr>
<tr>
<td align="right" height="25">
<asp:Label ID="Label4" runat="server" ForeColor="Black"
Text="Address :"></asp:Label>
</td>
<td class="style1">
<asp:TextBox ID="txtAdd" runat="server" CausesValidation="True"
Height="58px"
MaxLength="250" TabIndex="7" TextMode="MultiLine"
Width="150px"></asp:TextBox>
</td>
<td align="right" height="25">
<asp:Label ID="Label5" runat="server" ForeColor="Black" Text="City :"></asp:Label>
</td>
<td>
<asp:TextBox ID="txtCity" runat="server" Width="145px"></asp:TextBox>
</td>
</tr>
<tr>
<td align="right" height="25">
<asp:Label ID="Label3" runat="server" ForeColor="Black"
Text="State :"></asp:Label>
</td>
<td class="style1" >
<asp:DropDownList ID="txtState" runat="server" TabIndex="9" Width="145px">
<asp:ListItem Text="----Select----" Value="n"></asp:ListItem>
<asp:ListItem Text="Andhra Pradesh"></asp:ListItem>
<asp:ListItem Text="Assam"></asp:ListItem>
<asp:ListItem Text="Bihar"></asp:ListItem>
<asp:ListItem Text="Chhattisgarh"></asp:ListItem>
<asp:ListItem Text="Goa"></asp:ListItem>
<asp:ListItem Text="Gujarat"></asp:ListItem>
<asp:ListItem Text="Haryana"></asp:ListItem>
<asp:ListItem Text="Jammu and Kasmir"></asp:ListItem>
<asp:ListItem Text="Jharkhand"></asp:ListItem>
<asp:ListItem Text="Karnataka"></asp:ListItem>
<asp:ListItem Text="Maharashtra"></asp:ListItem>
<asp:ListItem Text="Madhya Pradesh"></asp:ListItem>
<asp:ListItem Text="Manipur"></asp:ListItem>
<asp:ListItem Text="Meghalaya"></asp:ListItem>
<asp:ListItem Text="Mizoram"></asp:ListItem>
<asp:ListItem Text="Nagaland"></asp:ListItem>
<asp:ListItem Text="New Delhi"></asp:ListItem>
<asp:ListItem Text="Orissa"></asp:ListItem>
<asp:ListItem Text="Punjab"></asp:ListItem>
<asp:ListItem Text="Rajasthan"></asp:ListItem>
<asp:ListItem Text="Sikkim"></asp:ListItem>
<asp:ListItem Text="Tamil Nadu"></asp:ListItem>
<asp:ListItem Text="Tripura"></asp:ListItem>
<asp:ListItem Text="Uttar Pradesh"></asp:ListItem>
<asp:ListItem Text="Uttarakhand"></asp:ListItem>
<asp:ListItem Text="West Bengal"></asp:ListItem>
</asp:DropDownList>
</td>
<td align="right" height="25">
<asp:Label ID="Label21" runat="server" ForeColor="Black" Text="Postal
Code :"></asp:Label>
</td>
<td colspan="2">
<asp:TextBox ID="txtPostal" runat="server" CausesValidation="True"
MaxLength="6"
TabIndex="10" Width="145px"></asp:TextBox>
</td>
</tr>
<tr>
<td align="right" height="25">
<asp:Label ID="Label7" runat="server" ForeColor="Black"
Text="Semester :"></asp:Label></td>
<td class="style1">
<asp:DropDownList ID="txtCountry" runat="server" TabIndex="9"
Width="145px">
<asp:ListItem Text="----Select----" Value="n"></asp:ListItem>
<asp:ListItem Value="sem1">Sem1</asp:ListItem>
<asp:ListItem Value="sem2">Sem2</asp:ListItem>
<asp:ListItem Value="sem3">Sem3</asp:ListItem>
<asp:ListItem Value="sem4">Sem4</asp:ListItem>
<asp:ListItem Value="sem5">Sem5</asp:ListItem>
<asp:ListItem Value="sem6">Sem6</asp:ListItem>
<asp:ListItem Value="sem7">Sem7</asp:ListItem>
<asp:ListItem Value="sem8">Sem8</asp:ListItem>
</asp:DropDownList>
</td>
<td align="right" height="25">
<asp:Label ID="Label8" runat="server" ForeColor="Black" Text="Phone
No :"></asp:Label>
</td>
<td colspan="2">
<asp:TextBox ID="txtPone" runat="server" CausesValidation="True"
MaxLength="10"
TabIndex="10" Width="145px"></asp:TextBox >
</td>
</tr>
<tr>
<td align="right" height="25">
<asp:Label ID="Label10" runat="server" Text="Branch :"
ForeColor="Black"></asp:Label></td>
<td >
<asp:DropDownList ID="DropDownList1" runat="server">
<asp:ListItem Value="CSE">CSE</asp:ListItem>
<asp:ListItem Value="Electrical">Electrical</asp:ListItem>
<asp:ListItem Value="Mechanical">Mechanical</asp:ListItem>
<asp:ListItem Value="Civil">Civil</asp:ListItem>
</asp:DropDownList>
</td>
<td align="right" height="25">
<asp:Label ID="Label11" runat="server" Text="Section :"
ForeColor="Black"></asp:Label></td>
<td >
<asp:DropDownList ID="DropDownList2" runat="server">
<asp:ListItem Value="A">A</asp:ListItem>
<asp:ListItem Value="B">B</asp:ListItem>
<asp:ListItem Value="C">C</asp:ListItem>
<asp:ListItem Value="D">D</asp:ListItem>
</asp:DropDownList>
</td>
</tr>
<tr>
<td align="center" colspan="5" style="height: 24px">
<asp:Button ID="Button1" runat="server" CssClass="bttn"
Text="Register Student" onclick="Button1_Click1" ForeColor="#0066FF" />
</td>
</tr>
</table>
</center>
</asp:Content>
Backed Code
using
using
using
using
using
using
using
System;
System.Collections.Generic;
System.Web;
System.Web.UI;
System.Web.UI.WebControls;
System.Data;
System.Data.SqlClient;
Label9.Visible = true;
Label9.Text = "Confirm Email Must be Filled !!!!!";
}
else if (txtFname.Text == string.Empty)
{
Label9.Visible = true;
Label9.Text = "First Name Must be Filled !!!!!";
}
Connection
using
using
using
using
using
using
using
using
using
using
using
using
System;
System.Data;
System.Configuration;
System.Linq;
System.Web;
System.Web.Security;
System.Web.UI;
System.Web.UI.HtmlControls;
System.Web.UI.WebControls;
System.Web.UI.WebControls.WebParts;
System.Xml.Linq;
System.Data.SqlClient;