ISAS Lab Assignment 1 2 3
ISAS Lab Assignment 1 2 3
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
<style type="text/css">
.style4
{
background-color: #996600;
}
.style6
{
color: #000000;
margin-left: 0px;
}
.style7
{
color: #CC6600;
}
.style8
{
background-color: #FFFFFF;
}
</style>
</head>
<body>
<form id="form1" runat="server">
<div>
}
protected void Button1_Click(object sender, EventArgs e)
{
try
{
string Question;
Question = DropDownList4.SelectedItem.ToString();
cn.Open();
SqlCommand cmd = new SqlCommand(str, cn);
cmd.ExecuteNonQuery();
Label20.Visible = true;
cn.Close();
}
catch (Exception ex)
{
ex.ToString();
Label21.Visible = true;
}
}
Source Code
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs"
Inherits="_Default" %>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
<style type="text/css">
.style4
{
background-color: #996600;
}
.style6
{
color: #000000;
margin-left: 0px;
}
.style7
{
color: #CC6600;
}
.style8
{
background-color: #FFFFFF;
}
</style>
</head>
<body>
<form id="form1" runat="server">
<div>
}
SqlConnection con = new SqlConnection("Data Source=.;Initial
Catalog=college;Integrated Security=True");
else
{
flag = 0;
}
tmp--;
}
if (flag == 1)
{
//Session["user"] = TextBox1.Text;
Response.Redirect("Default4.aspx",true);
//Label1.Text = "user name exist";
}
else
{
Label3.Visible = true;
}
}
Source Code (Login.aspx Page)
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Login.aspx.cs" Inherits="Login"
%>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
<style type="text/css">
.style1
{
color: #0066FF;
}
.style2
{
font-family: Arial, sans-serif;
font-weight: bold;
}
.style3
{
font-size: xx-large;
}
.style4
{
font-size: xx-large;
color: #FF9900;
}
.style5
{
color: #663300;
}
.style6
{
text-decoration: underline;
font-size: large;
}
</style>
</head>
<body bgcolor="#0099ff">
<form id="form1" runat="server">
<div>
<div>
<p class="style1" style="margin-left: 31px">
</p>
<p class="style1" style="margin-left: 31px">
<span class="style2"><u><span class="style4"
style="line-height: 115%; font-family: "Times New
Roman","serif"; mso-fareast-font-family: "Times New Roman"; mso-
fareast-theme-font: minor-fareast; mso-ansi-language: EN-US; mso-fareast-language: EN-US;
mso-bidi-language: AR-SA">
VYAS INSTITUTE OF ENGINEERING & TECHNOLOGY</span></u></span><span
style="mso-tab-count:
1"><span class="style3"
style="line-height: 115%; font-family: "Times New
Roman","serif"; mso-fareast-font-family: "Times New Roman"; mso-
fareast-theme-font: minor-fareast; mso-ansi-language: EN-US; mso-fareast-language: EN-US;
mso-bidi-language: AR-SA"> </span><span style="font-
size:11.0pt;
line-height:115%;font-family:"Times New Roman","serif";mso-fareast-
font-family:
"Times New Roman";mso-fareast-theme-font:minor-fareast;mso-ansi-language:EN-US;
mso-fareast-language:EN-US;mso-bidi-language:AR-SA">
</span></span>
</p>
<p class="style5" style="margin-left: 400px">
<span class="style6"><strong>Sign In</strong></span>
</p>
<p style="margin-left: 400px">
<asp:Label ID="Label1" runat="server" Text="User Name"></asp:Label>
<asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
<asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server"
ControlToValidate="TextBox1" ErrorMessage="You must enter username"
ForeColor="#CC3300"
meta:resourcekey="RequiredFieldValidator1Resource1"></asp:RequiredFieldValidator>
</p>
<p style="margin-left: 400px">
<asp:Label ID="Label2" runat="server" Text="Password"></asp:Label>
<asp:TextBox ID="TextBox2" runat="server"
TextMode="Password"></asp:TextBox>
<asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server"
ControlToValidate="TextBox1" ErrorMessage="You must Password
username"
ForeColor="#CC3300"
meta:resourcekey="RequiredFieldValidator1Resource1"></asp:RequiredFieldValidator>
</p>
<p style="margin-left: 400px">
<asp:Label ID="Label3" runat="server" ForeColor="Red"
meta:resourcekey="Label3Resource1"
Text="Login Failed. Incorrect Username or Password."
Visible="False"></asp:Label>
</p>
</div>
<p style="margin-left: 480px">
<asp:Button ID="Button1" runat="server" onclick="Button1_Click" Text="Submit"
/>
</p>
</div>
</form>
</body>
</html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
<style type="text/css">
.style2
{
font-family: Arial, sans-serif;
font-weight: bold;
}
.style4
{
font-size: xx-large;
color: #FF9900;
}
.style5
{
color: #FF0000;
font-size: xx-large;
}
</style>
</head>
<body bgcolor="#0099ff">
<form id="form1" runat="server">
<div>