Code
Code
Aspx:
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
<style type="text/css">
body {
margin: 0;
padding: 0;
}
.auto-style1 {
width: 100%;
border: 2px solid #000000;
margin-left: 0px;
margin-top: 0px;
height: 555px;
}
.auto-style3 {
height: 46px;
width: 510px;
}
.auto-style6 {
height: 46px;
width: 327px;
}
.auto-style8 {
height: 57px;
}
.auto-style9 {
height: 117px;
}
.auto-style10 {
margin-left: 0px;
}
.auto-style13 {
height: 55px;
width: 327px;
}
.auto-style14 {
height: 55px;
width: 510px;
}
.auto-style15 {
height: 86px;
width: 327px;
}
.auto-style16 {
height: 86px;
width: 510px;
}
.auto-style17 {
height: 30px;
width: 327px;
}
.auto-style18 {
height: 30px;
width: 510px;
}
.auto-style19 {
width: 327px;
height: 26px;
}
.auto-style20 {
width: 510px;
height: 26px;
}
.midnightblue-button {
background-color: midnightblue;
color: white;
}
.auto-style21 {
margin-top: 29px;
}
.auto-style23 {
font-weight: bold;
}
.form-container {
margin: 0;
padding: 0;
width: 100%;
height: 100%;
}
.auto-style24 {
width: 9px;
}
</style>
</head>
<body>
<form id="form1" runat="server" class="auto-style10">
<table class="auto-style1">
<tr>
<td class="auto-style24" style="font-family: Algerian; font-size:
xx-large; font-style: inherit; font-variant: normal" rowspan="9">
</td>
<td class="auto-style9" colspan="2" style="font-family: Algerian;
font-size: xx-large; font-style: inherit; font-variant: normal; background-color:
steelblue;">
<asp:Image ID="Image4" runat="server" CssClass="auto-style21"
Height="86px" ImageUrl="~/Images/login.jpg" Width="138px" />
&nb
sp;
LOGIN
</td>
</tr>
<tr>
<td class="auto-style19"></td>
<td class="auto-style20"></td>
</tr>
<tr>
<td class="auto-style15">
<asp:Image ID="Image2" runat="server" CssClass="auto-style10"
Height="43px" ImageUrl="~/Images/username.jpg" Width="50px" />
<strong><asp:Label
ID="Label1" runat="server" Text="UserName"></asp:Label>
</strong>
</td>
<td class="auto-style16">
<asp:TextBox ID="TextBox1" runat="server" Height="38px"
Width="326px"></asp:TextBox>
<br />
<asp:RequiredFieldValidator ID="TextBox1RequiredValidator"
runat="server"
ControlToValidate="TextBox1"
ErrorMessage="Enter UserName"
ForeColor="Red">
</asp:RequiredFieldValidator>
</td>
</tr>
<tr>
<td class="auto-style17"></td>
<td class="auto-style18"></td>
</tr>
<tr>
<td class="auto-style13">
<asp:Image ID="Image3" runat="server" Height="54px"
ImageUrl="~/Images/password.png" />
<strong><asp:Label
ID="Label2" runat="server" Text="Password"></asp:Label>
</strong>
</td>
<td class="auto-style14">
<asp:TextBox ID="TextBox2" runat="server" Height="39px"
Width="325px" CssClass="auto-style23"></asp:TextBox>
<br />
<br />
<asp:RegularExpressionValidator
ID="RegularExpressionValidator2" runat="server" ControlToValidate="TextBox2"
ErrorMessage="Password must contain only integers"
ForeColor="Red"
ValidationExpression="^\d+$">
</asp:RegularExpressionValidator>
</td>
</tr>
<tr>
<td class="auto-style6"></td>
<td class="auto-style3">
<asp:Label ID="Label3" runat="server" Text="label"
Visible="False"></asp:Label>
</td>
</tr>
<tr>
<td class="auto-style8" colspan="2">
&nb
sp;
&nb
sp;
<asp:Button ID="Button1" runat="server" Height="56px"
OnClick="Button1_Click" Text="LOGIN" Width="134px" CssClass="midnightblue-button"
/>
</td>
</tr>
<tr>
<td class="auto-style19"></td>
<td class="auto-style20"></td>
</tr>
<tr>
<td class="auto-style19"></td>
<td class="auto-style20"></td>
</tr>
</table>
</form>
</body>
</html>
CS:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data.SqlClient;
using System.Data;
namespace HOSTEL
{
public partial class Login : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
SqlConnection connection = new SqlConnection(@"Data Source=(localdb)\
MSSQLLocalDB;Initial Catalog=HOSTEL;Integrated Security=True");
SqlCommand cmd = new SqlCommand();
public void openconnection()
{
if (connection.State == System.Data.ConnectionState.Closed)
{
connection.Open();
}
}
public void closeconnection()
{
if (connection.State == System.Data.ConnectionState.Open)
{
connection.Close();
}
}
public void executeQuery(String query)
{
try
{
openconnection();
cmd = new SqlCommand(query, connection);
if (cmd.ExecuteNonQuery() == 1)
{
Label3.Text = "Login Successfull";
}
else
{
Label3.Text = "please enter correct username and
password .......";
}
}
catch (Exception ex)
{
Label3.Text = ex.Message;
}
finally
{
closeconnection();
}
}
connection.Open();
String insertquery = "INSERT INTO Login Values('" +
this.TextBox1.Text + "','" + this.TextBox2.Text + "')";
executeQuery(insertquery);
connection.Close();
Response.Redirect("Registration.aspx");
2) User registration
aspx:
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
<style type="text/css">
.forestgreen-button {
background-color: forestgreen;
}
.auto-style2 {
width: 99%;
height: 638px;
margin-bottom: 0px;
}
.auto-style5 {
height: 78px;
}
.auto-style6 {
height: 48px;
}
.auto-style7 {
height: 47px;
}
.midnightblue-button {
background-color: midnightblue;
color: white; /* Optionally, set the text color to white for better
visibility */
}
.auto-style8 {
height: 29px;
}
.auto-style9 {
width: 267px;
}
.auto-style10 {
height: 48px;
width: 267px;
}
.auto-style11 {
height: 47px;
width: 267px;
}
.auto-style12 {
height: 29px;
width: 267px;
}
.auto-style17 {
width: 296px;
}
.auto-style18 {
height: 48px;
width: 296px;
}
.auto-style19 {
height: 47px;
width: 296px;
}
.auto-style20 {
height: 29px;
width: 296px;
}
.auto-style22 {
width: 257px;
}
.auto-style23 {
height: 48px;
width: 257px;
}
.auto-style24 {
height: 47px;
width: 257px;
}
.auto-style25 {
height: 29px;
width: 257px;
}
</style>
</head>
<body style="height: 705px; width: 1297px; margin-left: 69px">
<form id="form1" runat="server" style="border: 2px solid black; padding:
10px;">
<table class="auto-style2">
<tr>
<td rowspan="11">
</td>
<td class="auto-style5" colspan="4" style="font-family: Algerian;
font-size: xx-large; font-style: inherit; font-variant: normal; background-
color:mediumvioletred; color: white;"> <asp:Image
ID="Image2" runat="server" Height="79px" ImageUrl="~/Images/hostel4.jpg"
Width="162px" />
User
REGISTRATION</td>
</tr>
<tr>
<td class="auto-style9"> </td>
<td class="auto-style17"> </td>
<td class="auto-style22"> </td>
<td> </td>
</tr>
<tr>
<td class="auto-style10">
<strong>
<asp:Label ID="Label1" runat="server" Text="Registration
ID"></asp:Label>
</strong>
</td>
<td class="auto-style18">
<asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
<br />
<asp:RequiredFieldValidator ID="TextBox1RequiredValidator"
runat="server"
ControlToValidate="TextBox1"
ErrorMessage="Enter ID"
ForeColor="Red">
</asp:RequiredFieldValidator>
</td>
<td class="auto-style23">
<strong>
<asp:Label ID="Label7" runat="server"
Text="City"></asp:Label>
</strong>
</td>
<td class="auto-style6">
<asp:TextBox ID="TextBox7" runat="server"
Height="27px"></asp:TextBox>
<br />
<asp:RequiredFieldValidator ID="RequiredFieldValidator1"
runat="server"
ControlToValidate="TextBox7"
ErrorMessage="Enter City"
ForeColor="Red">
</asp:RequiredFieldValidator>
</td>
</tr>
<tr>
<td class="auto-style10">
<strong>
<asp:Label ID="Label2" runat="server" Text="Full
Name"></asp:Label>
</strong>
</td>
<td class="auto-style18">
<asp:TextBox ID="TextBox2" runat="server"></asp:TextBox>
<br />
<asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server"
ControlToValidate="TextBox2"
ErrorMessage="Enter Full Name"
ForeColor="Red">
</asp:RequiredFieldValidator>
</td>
<td class="auto-style23">
<strong>
<asp:Label ID="Label8" runat="server"
Text="Taluka"></asp:Label>
</strong>
</td>
<td class="auto-style6">
<asp:TextBox ID="TextBox8" runat="server"></asp:TextBox>
<br />
CS:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data.SqlClient;
using System.Data;
namespace HOSTEL
{
public partial class Registration : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
SqlConnection connection = new SqlConnection(@"Data Source=(localdb)\
MSSQLLocalDB;Initial Catalog=HOSTEL;Integrated Security=True");
SqlCommand cmd = new SqlCommand();
public void openconnection()
{
if (connection.State == System.Data.ConnectionState.Closed)
{
connection.Open();
}
}
public void closeconnection()
{
if (connection.State == System.Data.ConnectionState.Open)
{
connection.Close();
}
}
public void executeQuery(String query)
{
try
{
openconnection();
cmd = new SqlCommand(query, connection);
if (cmd.ExecuteNonQuery() == 1)
{
Label11.Text = "Registration Successfull";
}
else
{
Label11.Text = "Query Not Executed";
}
}
catch (Exception ex)
{
Label11.Text = ex.Message;
}
finally
{
closeconnection();
}
}
}
Response.Redirect("hostelhighlights.aspx");
}
public void cleartexbox()
{
TextBox1.Text = "";
TextBox2.Text = "";
TextBox3.Text = "";
TextBox4.Text = " ";
TextBox5.Text = " ";
TextBox6.Text = " ";
TextBox7.Text = " ";
TextBox8.Text = " ";
TextBox9.Text = " ";
TextBox10.Text = " ";
}
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
<style type="text/css">
body {
margin: 0;
padding: 0;
}
.auto-style1 {
width: 100%;
border: 2px solid #000000;
margin-left: 0px;
margin-top: 0px;
height: 555px;
}
.auto-style9 {
height: 117px;
}
.auto-style10 {
margin-left: 0px;
}
.auto-style19 {
width: 173px;
height: 26px;
}
.auto-style20 {
width: 510px;
height: 26px;
}
.midnightblue-button {
background-color: midnightblue;
color: white;
}
.auto-style21 {
margin-top: 29px;
}
.form-container {
margin: 0;
padding: 0;
width: 100%;
height: 100%;
}
.auto-style35 {
width: 173px;
height: 39px;
}
.auto-style36 {
width: 510px;
height: 39px;
}
.auto-style37 {
width: 173px;
height: 38px;
}
.auto-style38 {
width: 510px;
height: 38px;
}
.auto-style39 {
width: 173px;
height: 40px;
}
.auto-style40 {
width: 510px;
height: 40px;
}
.auto-style41 {
height: 26px;
}
.auto-style42 {
width: 8px;
}
.auto-style43 {
margin-bottom: 23px;
}
.auto-style44 {
margin-bottom: 9px;
}
</style>
</head>
<body>
<form id="form1" runat="server" class="auto-style10">
<table class="auto-style1">
<tr>
<td style="font-family: Algerian; font-size: xx-large; font-
style: inherit; font-variant: normal" rowspan="16" class="auto-style42">
</td>
<td class="auto-style9" colspan="2" style="font-family: Algerian;
font-size: xx-large; font-style: inherit; font-variant: normal; background-color:
lightskyblue;">
<asp:Image ID="Image4" runat="server" CssClass="auto-style21"
Height="86px" ImageUrl="~/Images/hotel1.jpg" Width="138px" />
roo
m related information</td>
</tr>
<tr>
<td class="auto-style19"></td>
<td class="auto-style20"></td>
</tr>
<tr>
<td class="auto-style35">
<strong><asp:Label
ID="Label1" runat="server" Text="Room No"></asp:Label>
</strong>
</td>
<td class="auto-style36">
<asp:TextBox ID="TextBox1" runat="server" Height="27px"
Width="162px" CssClass="auto-style44"></asp:TextBox>
<br />
</td>
</tr>
<tr>
<td class="auto-style35"><strong>
<asp:Label ID="Label2" runat="server"
Text="Seater"></asp:Label>
</strong></td>
<td class="auto-style36">
<asp:TextBox ID="TextBox7" runat="server"></asp:TextBox>
</td>
</tr>
<tr>
<td class="auto-style37"><strong>
<asp:Label ID="Label3" runat="server" Text="Food
Status"></asp:Label>
</strong></td>
<td class="auto-style38">
<strong>
<asp:RadioButton ID="RadioButton1" runat="server"
Text="Without Food" OnCheckedChanged="RadioButton1_CheckedChanged" />
</strong> <strong>
<asp:RadioButton ID="RadioButton2" runat="server" Text="With
Food(Rs2000 per month extra)" OnCheckedChanged="RadioButton2_CheckedChanged" />
</strong>
<asp:TextBox ID="TextBox13" runat="server"
Visible="False"></asp:TextBox>
</td>
</tr>
<tr>
<td class="auto-style37"><strong>
<asp:Label ID="Label4" runat="server" Text="Applay
Date"></asp:Label>
</strong></td>
<td class="auto-style38">
<asp:TextBox ID="TextBox3" runat="server" CssClass="auto-
style43" type="date" Height="25px" Width="159px"></asp:TextBox>
</td>
</tr>
<tr>
<td class="auto-style35"><strong>
<asp:Label ID="Label6" runat="server" Text="Stay
Date"></asp:Label>
</strong></td>
<td class="auto-style36">
<asp:TextBox ID="TextBox5" runat="server" type="date"
Height="25px" Width="154px"></asp:TextBox>
</td>
</tr>
<tr>
<td class="auto-style39"><strong>
<asp:Label ID="Label7" runat="server"
Text="Duration"></asp:Label>
</strong></td>
<td class="auto-style40">
<asp:TextBox ID="TextBox6" runat="server" Height="26px"
Width="155px"></asp:TextBox>
</td>
</tr>
<tr>
<td class="auto-style39"><strong>
<asp:Label ID="Label10" runat="server" Text="Food
Fees"></asp:Label>
</strong></td>
<td class="auto-style40">
<asp:TextBox ID="TextBox8" runat="server" Height="25px"
Width="152px"></asp:TextBox>
</td>
</tr>
<tr>
<td class="auto-style39"><strong>
<asp:Label ID="Label11" runat="server" Text="Hostel
Fees"></asp:Label>
</strong></td>
<td class="auto-style40">
<asp:TextBox ID="TextBox9" runat="server" Height="24px"
Width="149px"></asp:TextBox>
</td>
</tr>
<tr>
<td class="auto-style39"><strong>
<asp:Label ID="Label12" runat="server" Text="Monthy
Fees"></asp:Label>
</strong></td>
<td class="auto-style40">
<asp:TextBox ID="TextBox10" runat="server" Height="25px"
Width="147px"></asp:TextBox>
</td>
</tr>
<tr>
<td class="auto-style39"><strong>
<asp:Label ID="Label14" runat="server" Text="Total
Fees"></asp:Label>
</strong></td>
<td class="auto-style40">
<asp:TextBox ID="TextBox12" runat="server" Height="25px"
Width="148px"></asp:TextBox>
</td>
</tr>
<tr>
<td class="auto-style39"> </td>
<td class="auto-style40">
</td>
</tr>
<tr>
<td class="auto-style41"
colspan="2"> &nb
sp;
<strong>
<asp:Button ID="Button1" runat="server" BackColor="#003399"
ForeColor="White" Height="51px" Text="SUBMIT" Width="127px"
OnClick="Button1_Click" />
</strong>
<asp:Label ID="Label9" runat="server"
Text="Label"></asp:Label>
</td>
</tr>
<tr>
<td class="auto-style19"></td>
<td class="auto-style20"></td>
</tr>
<tr>
<td class="auto-style41"
colspan="2"> &nb
sp;
</td>
</tr>
</table>
</form>
</body>
</html>
CS:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data.SqlClient;
using System.Data;
namespace HOSTEL
{
public partial class roominfo : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
SqlConnection connection = new SqlConnection(@"Data Source=(localdb)\
MSSQLLocalDB;Initial Catalog=HOSTEL;Integrated Security=True");
SqlCommand cmd = new SqlCommand();
public void openconnection()
{
if (connection.State == System.Data.ConnectionState.Closed)
{
connection.Open();
}
}
public void closeconnection()
{
if (connection.State == System.Data.ConnectionState.Open)
{
connection.Close();
}
}
public void executeQuery(String query)
{
try
{
openconnection();
cmd = new SqlCommand(query, connection);
if (cmd.ExecuteNonQuery() == 1)
{
Label9.Text = "Payment Successfull";
}
else
{
Label9.Text = "Enable to Pay";
}
}
catch (Exception ex)
{
Label9.Text = ex.Message;
}
finally
{
closeconnection();
}
}
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
<style type="text/css">
.auto-style1 {
margin-left: 0px;
margin-right: 0px;
}
.auto-style5 {
height: 51px;
width: 1198px;
}
.auto-style7 {
width: 1198px;
height: 39px;
}
.auto-style8 {
height: 26px;
width: 1198px;
}
.auto-style10 {
height: 60px;
width: 1198px;
}
.midnightblue-button {
background-color: midnightblue;
color: white; /* Optionally, set the text color to white for better
visibility */
}
.auto-style11 {
height: 20px;
width: 1198px;
}
.auto-style12 {
height: 15px;
width: 1198px;
}
</style>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:Panel ID="Panel1" runat="server" CssClass="auto-style1"
Heght="1087px" ImageUrl="~/Images/hostel.jpg" Width="1190px" style="border: 2px
solid black;">
<table>
<tr>
<td style="font-family: Algerian; font-size: xx-large;
font-style: inherit; font-variant: normal" class="auto-
style8"> &
nbsp; &nbs
p; &
nbsp; </td>
</tr>
<tr>
<td style="font-family: Algerian; font-size: xx-large;
font-style: inherit; font-variant: normal; background-color: midnightblue; color:
white;" class="auto-style7"> Hostel Highlights</td>
</tr>
<tr>
<td style="font-family: Algerian; font-size: xx-large;
font-style: inherit; font-variant: normal" class="auto-style8"></td>
</tr>
<tr>
<td style="font-family: inherit; font-variant: normal;
background-color: darkred;" class="auto-style5">
<strong>
<asp:Label ID="Label1" runat="server"
Text="HOSTEL FACILITIES" ForeColor="White"></asp:Label>
</strong>
</td>
</tr>
<tr>
<td class="auto-style11" style="font-family:inherit;
font-variant: normal"></td>
</tr>
<tr>
<td style="font-family: inherit; font-variant: normal;
background-color: #96b6d8;" class="auto-style5">
<strong>
<asp:Label ID="Label2" runat="server" Text="1.
24/7 WiFi" ForeColor="Black"></asp:Label>
</strong>
</td>
</tr>
<tr>
<td class="auto-style11" style="font-family: inherit;
font-variant: normal"></td>
</tr>
<tr>
<td class="auto-style5" style="font-family: inherit;
background-color: #96b6d8;">
<strong>
<asp:Label ID="Label3" runat="server" Text="2.
Spacious Rooms"></asp:Label>
</strong>
</td>
</tr>
<tr>
<td class="auto-style11" style="font-family: inherit;
font-variant: normal"></td>
</tr>
<tr>
<td style="font-family: inherit; font-variant: normal;
background-color: darkred;" class="auto-style5">
<strong>
<asp:Label ID="Label4" runat="server"
Text="ADDITIONAL SERVICES" ForeColor="White"></asp:Label>
</strong>
</td>
</tr>
<tr>
<td class="auto-style11" style="font-family: inherit;
font-variant: normal"></td>
</tr>
<tr>
<td style="font-family: inherit; font-variant: normal;
background-color: #96b6d8;">
<strong>
<asp:Label ID="Label5" runat="server" Text="1.
Laundry Service"></asp:Label>
</strong>
</td>
</tr>
<tr>
<td class="auto-style11" style="font-family: inherit;
font-variant: normal"></td>
</tr>
<tr>
<td style="font-family: inherit; font-variant: normal;
background-color: #96b6d8;">
<strong>
<asp:Label ID="Label6" runat="server" Text="2.
Security & CCTV Surveillance"></asp:Label>
</strong>
</td>
</tr>
<tr>
<td class="auto-style12" style="font-family: inherit;
font-variant: normal"></td>
</tr>
<tr>
<td style="font-family: inherit; font-variant: normal;
background-color: #96b6d8;">
<strong>
<asp:Label ID="Label7" runat="server" Text="3.
Common Room & Entertainment"></asp:Label>
</strong>
</td>
</tr>
<tr>
<td class="auto-style11" style="font-family: inherit;
font-variant: normal"></td>
</tr>
<tr>
<td class="auto-style10" style="font-family: inherit;
font-variant:
normal"> &
nbsp; &nbs
p; &
nbsp;
<strong>
<asp:Button ID="Button1" runat="server"
CssClass="midnightblue-button" Height="56px" Text="NEXT" Width="158px"
OnClick="Button1_Click" />
</strong> </td>
</tr>
<tr>
<td class="auto-style8" style="font-family: inherit;
font-variant: normal"> </td>
</tr>
</table>
</asp:Panel>
</div>
</form>
</body>
</html>
CS:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
namespace HOSTEL
{
public partial class hostelhighlights : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
5) Payment:
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
<style type="text/css">
.auto-style1 {
margin-left: 9px;
}
.auto-style2 {
width: 100%;
}
.auto-style3 {
height: 52px;
}
.auto-style12 {
width: 258px;
}
.auto-style13 {
height: 52px;
width: 258px;
}
.auto-style14 {
width: 268px;
}
.auto-style15 {
height: 52px;
width: 268px;
}
.auto-style16 {
width: 292px;
}
.auto-style17 {
height: 52px;
width: 292px;
}
.auto-style18 {
width: 258px;
height: 49px;
}
.auto-style19 {
width: 268px;
height: 49px;
}
.auto-style20 {
width: 292px;
height: 49px;
}
.auto-style21 {
height: 49px;
}
.midnightblue-button {
background-color: midnightblue;
color: white; /* Optionally, set the text color to white for better
visibility */
}
</style>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:Panel ID="Panel1" runat="server" CssClass="auto-style1"
Height="1266px" Width="1044px" style="border: 2px solid black;">
<table class="auto-style2">
<tr>
<td class="auto-style3" colspan="4" style="font-family:
Algerian; font-size: xx-large; font-style: inherit; font-variant: normal;
background-color: midnightblue; color: white;"
> &n
bsp;  
; ON
LINE PAYMENT</td>
</tr>
<tr>
<td class="auto-style12"></td>
<td class="auto-style14"></td>
<td class="auto-style16"></td>
<td></td>
</tr>
<tr>
<td class="auto-style3" colspan="4" style="font-family:
Algerian; font-size: x-large; background-color: deepskyblue; color:
white;"> &
nbsp; &nbs
p;
Select Payment Option</td>
</tr>
<tr>
<td class="auto-style12"></td>
<td class="auto-style14"></td>
<td class="auto-style16"></td>
<td></td>
</tr>
<tr>
<td class="auto-style18"><strong>
&nb
sp;
<asp:Label ID="Label8" runat="server" Text="Payment
Option"></asp:Label>
</strong></td>
<td class="auto-style19">
<asp:TextBox ID="TextBox7" runat="server"
Visible="False"></asp:TextBox>
</td>
<td class="auto-style20"></td>
<td class="auto-style21"></td>
</tr>
<tr>
<td class="auto-style13">
<asp:Image ID="Image5" runat="server" Height="91px"
ImageUrl="~/Images/credit.jpg" Width="116px" />
<br />
<strong>
<asp:RadioButton ID="RadioButton1" runat="server"
Text="Credit Card" OnCheckedChanged="RadioButton1_CheckedChanged" />
</strong>
</td>
<td class="auto-style15">
<asp:Image ID="Image6" runat="server" Height="91px"
ImageUrl="~/Images/netbanking.jpg" Width="116px" />
<br />
<strong>
<asp:RadioButton ID="RadioButton2" runat="server"
Text="Net Banking" OnCheckedChanged="RadioButton2_CheckedChanged" />
</strong>
</td>
<td class="auto-style17">
<asp:Image ID="Image7" runat="server" Height="91px"
ImageUrl="~/Images/paypal.jpg" Width="116px" />
<br />
<strong>
<asp:RadioButton ID="RadioButton3" runat="server"
Text="PayPal" OnCheckedChanged="RadioButton3_CheckedChanged" />
<br />
</strong>
</td>
<td class="auto-style3">
<asp:Image ID="Image8" runat="server" Height="91px"
ImageUrl="C:\asp.net\RRS\RRS\RRS\Images\debit.jpg" Width="116px" />
<br />
<strong>
<asp:RadioButton ID="RadioButton4" runat="server"
Text="Debit Card" OnCheckedChanged="RadioButton4_CheckedChanged" />
<br />
</strong></td>
</tr>
<tr>
<td class="auto-style13"> </td>
<td class="auto-style15"> </td>
<td class="auto-style17"> </td>
<td class="auto-style3"> </td>
</tr>
<tr>
<td class="auto-style3" colspan="4" style="font-family:
Algerian; font-size: x-large; background-color: deepskyblue; color:
white;"> &
nbsp; &nbs
p; Personal
Information</td>
</tr>
<tr>
<td class="auto-style13"> </td>
<td class="auto-style15"> </td>
<td class="auto-style17"> </td>
<td class="auto-style3"> </td>
</tr>
<tr>
<td class="auto-style13">
<strong>
<asp:Label ID="Label1" runat="server" Text="Email
Address"></asp:Label>
</strong>
</td>
<td class="auto-style15">
<asp:TextBox ID="TextBox1" runat="server"
Height="28px" Width="168px" TextMode="MultiLine"></asp:TextBox>
<br />
<asp:RegularExpressionValidator
ID="RegularExpressionValidator1" runat="server" ControlToValidate="TextBox1"
ErrorMessage="Please enter a valid email address" ForeColor="Red"
ValidationExpression="\b[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Z|a-z]{2,}\
b">
</asp:RegularExpressionValidator>
</td>
<td class="auto-style17"> </td>
<td class="auto-style3"> </td>
</tr>
<tr>
<td class="auto-style13">
<strong>
<asp:Label ID="Label2" runat="server" Text="Full
Name"></asp:Label>
</strong>
</td>
<td class="auto-style15">
<asp:TextBox ID="TextBox2" runat="server"
Height="28px" TextMode="MultiLine" Width="169px"></asp:TextBox>
</td>
<td class="auto-style17"> </td>
<td class="auto-style3"> </td>
</tr>
<tr>
<td class="auto-style13"> </td>
<td class="auto-style15"> </td>
<td class="auto-style17"> </td>
<td class="auto-style3"> </td>
</tr>
<tr>
<td class="auto-style3" colspan="4" style="font-family:
Algerian; font-size: x-large; background-color: deepskyblue; color:
white;"> &
nbsp; &nbs
p; Credit Card
Information</td>
</tr>
<tr>
<td class="auto-style13"> </td>
<td class="auto-style15"> </td>
<td class="auto-style17"> </td>
<td class="auto-style3"> </td>
</tr>
<tr>
<td class="auto-style13"><strong>
<asp:Label ID="Label3" runat="server"
Text="CardHolder Name"></asp:Label>
</strong></td>
<td class="auto-style15"> </td>
<td class="auto-style17"> </td>
<td class="auto-style3"> </td>
</tr>
<tr>
<td class="auto-style3" colspan="2">
<asp:TextBox ID="TextBox3" runat="server"
Width="168px" Height="27px" TextMode="MultiLine"></asp:TextBox>
</td>
<td class="auto-style17"> </td>
<td class="auto-style3"> </td>
</tr>
<tr>
<td class="auto-style13"><strong>
<asp:Label ID="Label4" runat="server" Text="Card
Number"></asp:Label>
</strong></td>
<td class="auto-style15"> </td>
<td class="auto-style17"> </td>
<td class="auto-style3"> </td>
</tr>
<tr>
<td class="auto-style3" colspan="2">
<asp:TextBox ID="TextBox4" runat="server"
Width="170px" Height="28px" TextMode="MultiLine"></asp:TextBox>
</td>
<td class="auto-style17"> </td>
<td class="auto-style3"> </td>
</tr>
<tr>
<td class="auto-style13"></td>
<td class="auto-style15"></td>
<td class="auto-style17"></td>
<td class="auto-style3"></td>
</tr>
<tr>
<td class="auto-style13"><strong>
<asp:Label ID="Label5" runat="server" Text="CVV
Number"></asp:Label>
</strong></td>
<td class="auto-style15">
<asp:TextBox ID="TextBox5" runat="server"
Width="171px" Height="29px"></asp:TextBox>
<br />
<asp:RangeValidator ID="RangeValidator1"
runat="server" ControlToValidate="TextBox5"
ErrorMessage="Enter value in specified range" ForeColor="Red"
MaximumValue="999" MinimumValue="100"
SetFocusOnError="True" Type="Integer"></asp:RangeValidator>
</td>
<td class="auto-style17"> </td>
<td class="auto-style3"> </td>
</tr>
<tr>
<td class="auto-style13"><strong>
<asp:Label ID="Label6" runat="server" Text=" Total
Rs."></asp:Label>
</strong></td>
<td class="auto-style15">
<asp:TextBox ID="TextBox6" runat="server"
Height="29px" Width="171px"></asp:TextBox>
</td>
<td class="auto-style17"> </td>
<td class="auto-style3"> </td>
</tr>
<tr>
<td class="auto-style13"></td>
<td class="auto-style15">
<asp:Button ID="Button1" runat="server" Height="46px"
Text="PAY" Width="130px" CssClass="midnightblue-button"
OnClick="Button1_Click"/>
</td>
<td class="auto-style17">
<asp:Label ID="Label9" runat="server"
Text="Label"></asp:Label>
</td>
<td class="auto-style3"></td>
</tr>
<tr>
<td class="auto-style13"> </td>
<td class="auto-style15"> </td>
<td class="auto-style17"> </td>
<td class="auto-style3"> </td>
</tr>
<tr>
<td class="auto-style13"> </td>
<td class="auto-style15"> </td>
<td class="auto-style17"> </td>
<td class="auto-style3"> </td>
</tr>
</table>
</asp:Panel>
</div>
</form>
</body>
</html>
CS:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data.SqlClient;
using System.Data;
namespace HOSTEL
{
public partial class payment : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
SqlConnection connection = new SqlConnection(@"Data Source=(localdb)\
MSSQLLocalDB;Initial Catalog=HOSTEL;Integrated Security=True");
SqlCommand cmd = new SqlCommand();
public void openconnection()
{
if (connection.State == System.Data.ConnectionState.Closed)
{
connection.Open();
}
}
public void closeconnection()
{
if (connection.State == System.Data.ConnectionState.Open)
{
connection.Close();
}
}
public void executeQuery(String query)
{
try
{
openconnection();
cmd = new SqlCommand(query, connection);
if (cmd.ExecuteNonQuery() == 1)
{
Label9.Text = "Payment Successfull";
}
else
{
Label9.Text = "Enable to Pay";
}
}
catch (Exception ex)
{
Label9.Text = ex.Message;
}
finally
{
closeconnection();
}
}
executeQuery(insertquery);
connection.Close();https://localhost:44314/payment.aspx.cs
Response.Redirect("PreviousQue.aspx");
}
}
}