Certificate: Smt. Sushiladevi Deshmukh College of Arts, SCIENCE AND COMMERCE, Airoli, Navi Mumbai - 400 708
Certificate: Smt. Sushiladevi Deshmukh College of Arts, SCIENCE AND COMMERCE, Airoli, Navi Mumbai - 400 708
Date :
Certificate
This is to certify that Mr. / _Sudarshan Date
seat no of B.Sc. IT Semester V has completed the practical work in the subject of
“ASP dot Net with C#” during the academic year 2018 – 19 under the guidance of Prof. Dr. Prakash
Naik. being the partial requirement for the fulfillment of the curriculum of Degree of Bachelor of Science
Signature of External
Principal
College Seal
INDEX
Sr List of Practical Date Signature
No.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
publicpartialclassproduct : System.Web.UI.Page
{
protectedvoid Page_Load(object sender, EventArgs e)
{
}
protectedvoid Button1_Click(object sender, EventArgs e)
{
int a, b, c, d, f;
a = int.Parse(TextBox1.Text);
b = int.Parse(TextBox2.Text);
c = int.Parse(TextBox3.Text);
d = int.Parse(TextBox4.Text);
f = a * b * c * d;
Label1.Text = "The Product is = " + f;
}
}
namespace stringoperator
{
class Program
{
static void Main(string[] args)
{
string[] myWords;
start:
string myString;
char[] separator={' '};
Console.WriteLine("Type any string Please");
myString=Console.ReadLine();
myWords=myString.Split(separator);
foreach (string word in myWords)
{
Console.Write("\"{0}\"", word);
}
Console.ReadKey();
Console.WriteLine();
Console.Clear();
goto start;
}
}
}
Output:
c. Create an application that receives the (Student Id, Student Name, Course Name, Date of Birth)
information from a set of students. The application should also display the information of all the
students once the data entered.
Code:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace studentdetail
{
class Program
{
public struct Student
{
public int stud_id;
public string stud_name, course_name, stud_dob;
}
static void Main(string[] args)
{
Student[] ob1 = new Student[3];
int a;
for (a = 0; a < 3; a++)
{
Console.WriteLine("Enter Student id = ");
ob1[a].stud_id = int.Parse(Console.ReadLine());
Console.WriteLine("Enter Student Name = ");
ob1[a].stud_name = Console.ReadLine();
Console.WriteLine("Enter Student Course name = ");
ob1[a].course_name = Console.ReadLine();
Console.WriteLine("Enter Student date of birth = ");
ob1[a].stud_dob = Console.ReadLine();
}
Console.WriteLine("\t\t\t\t\tSTUDENT INFORMATION");
Console.WriteLine("*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-**-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-
*-*-*-*-*-*-*-*-*-*-*-*");
Console.WriteLine("|\t Student id\t|\tStudent Name\t|\tCourse Name\t|\tStudent DOB\t|");
Console.WriteLine("*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-**-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-
*-*-*-*-*-*-*-*-*-*-*-*");
for (a = 0; a < 3; a++)
{
Console.WriteLine("|\t\t" + ob1[a].stud_id + "\t|\t" + ob1[a].stud_name + "\t|\t" +
ob1[a].course_name + "\t\t|\t" + ob1[a].stud_dob + "\t|");
}
Console.WriteLine("*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-**-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-
*-*-*-*-*-*-*-*-*-*-*-*");
Console.ReadKey();
}
}
}
Fibonacci.aspx
<%@PageLanguage="C#"AutoEventWireup="true"CodeFile="string3.aspx.cs"Inherits="string3"%>
<htmlxmlns="http://www.w3.org/1999/xhtml">
<headrunat="server">
<title></title>
<styletype="text/css">
.style1
{
font-size: x-large;
}
.style2
{
font-size: large;
}
</style>
</head>
<body>
<formid="form1"runat="server">
<div>
<br/>
strong><spanclass="style1">FIBONACCI SERIES</span><br/>
<br/>
<spanclass="style2"> Enter Number :</span></strong>
<asp:TextBoxID="TextBox1"runat="server"></asp:TextBox>
<br/>
<br/>
<asp:ButtonID="Button1"runat="server"onclick="Button1_Click"
style="font-weight: 700"Text="SUBMIT"/>
<br/>
<br/>
<br/>
<asp:ListBoxID="ListBox1"runat="server"Height="283px"
style="font-weight: 700; color: #00FF00; font-size: large"Width="120px">
</asp:ListBox>
</div>
</form>
</body>
</html>
Fibonacci.aspx.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
publicpartialclassstring3 : System.Web.UI.Page
{
protectedvoid Page_Load(object sender, EventArgs e)
{
}
protectedvoid Button1_Click(object sender, EventArgs e)
{
int n;
n = int.Parse(TextBox1.Text);
int a = 0;
int b = 1;
for (int i = 0; i < n; i++)
{
int temp = a;
a = b;
b = temp + b;
ListBox1.Items.Add("" + a);
}
}
}
Prime.aspx
<%@PageLanguage="C#"AutoEventWireup="true"CodeFile="prime.aspx.cs"Inherits="prime"%>
Prime.aspx.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
publicpartialclassprime : System.Web.UI.Page
{
protectedvoid Page_Load(object sender, EventArgs e)
{
}
protectedvoid Button1_Click(object sender, EventArgs e)
{
int flag = 0;
int x;
x = int.Parse(TextBox1.Text);
bool r;
}
}
<htmlxmlns="http://www.w3.org/1999/xhtml">
<headid="Head1"runat="server">
<title></title>
<styletype="text/css">
.style1
{
font-size: x-large;
}
.style2
{
font-size: large;
}
</style>
</head>
<body>
<formid="form1"runat="server">
<div>
<strong><spanclass="style1">CHECK VOWEL
CHARECTER</span><br/>
<spanclass="style2"> Enter Charecter :</span></strong>
<asp:TextBoxID="TextBox1"runat="server"></asp:TextBox>
<br/>
<asp:ButtonID="Button1"runat="server"onclick="Button1_Click"
style="font-weight: 700"Text="SUBMIT"/>
<br/>
<asp:ListBoxID="ListBox1"runat="server"Height="94px"
style="font-weight: 700; color: #00FF00; font-size: large"Width="411px">
</asp:ListBox>
</div>
</form>
</body>
</html>
Vowel.aspx.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
publicpartialclassvowel : System.Web.UI.Page
{
protectedvoid Page_Load(object sender, EventArgs e)
{
}
protectedvoid Button1_Click(object sender, EventArgs e)
{
char c;
c = char.Parse(TextBox1.Text);
switch (c)
{
case'a':
case'e':
case'i':
case'o':
case'u':
case'A':
case'E':
case'I':
case'O':
case'U': ListBox1.Items.Add("'" + c + "' Is A Vowel...!!!");
break;
}
}
<htmlxmlns="http://www.w3.org/1999/xhtml">
<headid="Head1"runat="server">
<title></title>
<styletype="text/css">
.style1 { font-size: x-large; }
</style>
</head>
<body>
<formid="form1"runat="server">
<div>
<spanclass="style1"> </span><strong><spanclass="style1">FOREACH LOOP WITH
ARRAY</span><br/>
</strong>
<asp:ListBoxID="ListBox1"runat="server"Height="181px"
style="font-weight: 700; color: #00FF00; font-size: large"Width="177px">
</asp:ListBox>
</div>
</form>
</body>
</html>
foreach.aspx.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
publicpartialclassforeach1 : System.Web.UI.Page
{
protectedvoid Page_Load(object sender, EventArgs e)
{
int[] myArray = { 24, 25, 26, 27,28};
foreach (int m in myArray)
{
ListBox1.Items.Add(" " + m);
}
}
}
<htmlxmlns="http://www.w3.org/1999/xhtml">
<headid="Head1"runat="server">
<title></title>
<styletype="text/css">
.style1
{
font-size: x-large;
}
.style2
{
font-size: large;
}
</style>
</head>
<body>
<formid="form1"runat="server">
<div>
strong><spanclass="style1"> REVERSE
NUMBER</span><br/>
<spanclass="style2"> Enter Number :</span></strong>
<asp:TextBoxID="TextBox1"runat="server"></asp:TextBox>
<br/>
<asp:ButtonID="Button1"runat="server"onclick="Button1_Click"
style="font-weight: 700"Text="SUBMIT"/>
<br/>
<asp:ListBoxID="ListBox1"runat="server"Height="94px"
style="font-weight: 700; color: #00FF00; font-size: large"Width="411px">
</asp:ListBox>
</div>
</form>
</body>
</html>
Reverse.aspx.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
publicpartialclassreverse : System.Web.UI.Page
{
protectedvoid Page_Load(object sender, EventArgs e)
{
}
protectedvoid Button1_Click(object sender, EventArgs e)
{
int num = int.Parse(TextBox1.Text);
int rev = 0, temp = 0, sum = 0;
while (num > 0)
{
temp = num % 10;
}
}
<htmlxmlns="http://www.w3.org/1999/xhtml">
<headid="Head1"runat="server">
<title></title>
<styletype="text/css">
.style1
{
font-size: x-large;
}
.style2
{
font-size: large;
}
</style>
</head>
<body>
<formid="form1"runat="server">
<div>
<strong><spanclass="style1"> FACTORIAL
NUMBER</span><br/>
<spanclass="style2"> Enter Number :</span></strong>
<asp:TextBoxID="TextBox1"runat="server"></asp:TextBox>
<br/>
<asp:ButtonID="Button1"runat="server"onclick="Button1_Click"
style="font-weight: 700"Text="SUBMIT"/>
<br/>
<asp:ListBoxID="ListBox1"runat="server"Height="94px"
style="font-weight: 700; color: #00FF00; font-size: large"Width="411px">
</asp:ListBox>
</div>
</form>
</body>
</html>
Factorial.aspx.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
publicpartialclassfactorial : System.Web.UI.Page
{
protectedvoid Page_Load(object sender, EventArgs e)
{
}
protectedvoid Button1_Click(object sender, EventArgs e)
{
int n, i, f = 1;
n = int.Parse(TextBox1.Text);
for (i = 1; i <= n; i++)
{
f = f * i;
}
ListBox1.Items.Add("The Factorial of " + n + " is =" + f);
}
}
money.aspx
<%@PageLanguage="C#"AutoEventWireup="true"CodeFile="money.aspx.cs"Inherits="money"%>
<htmlxmlns="http://www.w3.org/1999/xhtml">
<headid="Head1"runat="server">
<title></title>
<styletype="text/css">
.style1
{
font-size: x-large;
}
.style2
{
font-size: large;
}
</style>
</head>
<body>
<formid="form1"runat="server">
<div>
<strong><spanclass="style1"> MONEY CONVERSION
</span><br/>
<spanclass="style2"> Enter Amount :</span></strong>
<asp:TextBoxID="TextBox1"runat="server"></asp:TextBox>
<br/>
<asp:ButtonID="Button1"runat="server"onclick="Button1_Click"
style="font-weight: 700"Text="SUBMIT"/>
<br/>
<asp:ListBoxID="ListBox1"runat="server"Height="94px"
style="font-weight: 700; color: #00FF00; font-size: large"Width="411px">
</asp:ListBox>
</div>
</form>
</body>
</html>
money.aspx.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
publicpartialclassmoney : System.Web.UI.Page
{
protectedvoid Page_Load(object sender, EventArgs e)
{
}
protectedvoid Button1_Click(object sender, EventArgs e)
{
double n;
n = double.Parse(TextBox1.Text);
ListBox1.Items.Add("the value of "+n+" rupees in dollar is= "+(n/63));
}
}
i) Function Overloading
Source Code:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace ConsoleApplication12
{
class A
{
private int k;
public void display()
{
k = 1000;
Console.WriteLine("The Value Of K Is: " + k);
}
public void display(int p)
{
k = p;
Console.WriteLine("The Value Of K Is: "+k);
}
}
class B
{
static void Main(string[] args)
{
A x = new A();
x.display();
x.display(3413);
Console.ReadKey();
}
}
}
Output:
A. Single Inheritance:
Source Code:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
class shape
{
protected int width, height;
public void setwidth(int w)
{
width = w;
}
public void setHeight(int h)
{
height = h;
}
}
class Rectangle : shape
{
public int getArea()
{
return width * height;
}
}
class RectangleTest
{
static void Main(string[] args)
{
Rectangle rect = new Rectangle();
rect.setHeight(7);
rect.setwidth(5);
Output:
B. Multi-Level Inheritance:
Source Code:
using System;
class Abc
{
public void Show()
{
Console.WriteLine("Displayed from main base class Abc");
}
}
class Bbc : Abc
{
public void Display()
{
Console.WriteLine("Displayed from sub base class Bbc");
}
}
class Pqr : Bbc
{
public void ShowMe()
{
Console.WriteLine("Displayed from derived class Pqr");
}
}
class Test
{
public static void Main()
{
Pqr p = new Pqr();
p.Show();
p.Display();
p.ShowMe();
Console.Read();
}
}
Output:
C. Heirarchical Inheritance:
Source Code:
using System;
class HeadOffice
{
public void HeadOfficeAddress()
{
Console.WriteLine("Head Office Address");
}
}
class BranchOffice1:HeadOffice
{
public void BranchOfficeAddress()
{
Console.WriteLine("Branch1 Office Address");
}
}
class BranchOffice2 : HeadOffice
{
public void BranchOfficeAddress()
{
Console.WriteLine("Branch2 Office Address");
}
}
class Test
{
static void Main(string[] args)
{
HeadOffice ho = new HeadOffice();
ho.HeadOfficeAddress();
BranchOffice1 bo1 = new BranchOffice1();
bo1.BranchOfficeAddress();
BranchOffice2 bo2 = new BranchOffice2();
bo2.BranchOfficeAddress();
Console.ReadKey();
}
}
Output:
Source Code:
using System;
class Test
{
public Test()
{
Console.WriteLine("Default Constructor of Test class");
}
public Test(int x)
{
Console.WriteLine("Parameterized Constructor of Test class");
}
public Test(string text)
{
Console.WriteLine("Parameterized Constructor of Test class with a string
parameter");
}
static Test()
{
Console.WriteLine("Static Constructor of Test class");
}
}
class Demo
{
public static void Main()
{
Test t = new Test();
Test t1 = new Test(10);
Test t2 = new Test("abc");
Console.Read();
}
}
Output:
iv) Intefaces.
Source Code:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
public interface IEmployee
{
void DisplayEmployeeDetails();
}
public interface ICompany
{
void DisplayEmpDetails();
}
public class Employee : IEmployee, ICompany
{
void ICompany.DisplayEmpDetails()
{
Console.WriteLine("ICompany Employee No.: 009");
}
void IEmployee.DisplayEmployeeDetails()
{
Console.WriteLine("ICompany Employee Name: xyz");
}
}
class Program
{
static void Main(string[] args)
{
IEmployee iemp = new Employee();
iemp.DisplayEmployeeDetails();
Output:
A. Delegates:
Source Code:
using System;
//Declare Delegate
public delegate int MyDel(int x,int y);
class Abc
{
public int Add(int a, int b)
{
int c = a + b;
return c;
}
public static int Sub(int x, int y)
{
int z = x - y;
return z;
}
}
class Test
{
public static void Main()
{
Abc a1 = new Abc();
//Delegate initialisation
MyDel m1 = new MyDel(a1.Add);
//Delegate invocation
Console.WriteLine(""+m1(10, 20));
MyDel m2 = new MyDel(Abc.Sub);
//Delegate invocation
Console.WriteLine("" + m2(100, 76));
Console.Read();
}
}
Output:
B. Events:
Source Code:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace WindowsFormsApplication2
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
Output:
Form Layout:
Default.aspx:
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs"
Inherits="_Default" %>
</div>
<asp:SiteMapDataSource ID="SiteMapDataSource1" runat="server" />
</form>
</body>
</html>
Output:
Validate.aspx
<%@PageLanguage="C#"AutoEventWireup="true"CodeFile="validate.aspx.cs"Inherits="validate"%>
<htmlxmlns="http://www.w3.org/1999/xhtml">
<headrunat="server">
<title></title>
<styletype="text/css">
.style1
{
width: 100%;
}
.style2
{
text-align: right;
}
.style3
{
text-align: center;
}
.style4
{
color: #FF0000;
}
.style5
{
text-align: center;
color: #FF0000;
}
.style6
{
text-align: center;
font-size: x-large;
}
.style7
{
text-align: right;
font-weight: bold;
}
</style>
</head>
<body>
<formid="form1"runat="server">
<div>
<tableclass="style1"border="0"cellpadding="3px"cellspacing="0px">
<tr>
<tdclass="style2">
</td>
<tdclass="style3">
</td>
<tdclass="style3">
</td>
<tdclass="style5">
</td>
</tr>
<tr>
<tdclass="style2">
</td>
<tdclass="style6"colspan="2">
<strong>REGISTRATION FORM</strong></td>
<tdclass="style5">
</td>
</tr>
<tr>
<tdclass="style2">
</td>
<tdclass="style3">
</td>
<tdclass="style3">
</td>
<tdclass="style5">
</td>
</tr>
<tr>
<tdclass="style7">
Name :
</td>
<tdclass="style3">
<asp:TextBoxID="TextBox1"runat="server"></asp:TextBox>
</td>
<tdclass="style3">
<asp:RequiredFieldValidatorID="RequiredFieldValidator1"runat="server"
ControlToValidate="TextBox1"ErrorMessage="Enter
name"CssClass="style4"></asp:RequiredFieldValidator>
</td>
<tdclass="style5">
</td>
</tr>
<tr>
<tdclass="style7">
Email :</td>
<tdclass="style3">
<asp:TextBoxID="TextBox2"runat="server"></asp:TextBox>
</td>
<tdclass="style3">
<asp:RequiredFieldValidatorID="RequiredFieldValidator2"runat="server"
ControlToValidate="TextBox2"ErrorMessage="Enter
Email"CssClass="style4"></asp:RequiredFieldValidator>
</td>
<tdclass="style3">
<asp:RegularExpressionValidatorID="RegularExpressionValidator1"runat="server"
ControlToValidate="TextBox2"ErrorMessage="Invalid Email"
ValidationExpression="\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*"
CssClass="style4"></asp:RegularExpressionValidator>
</td>
</tr>
<tr>
<tdclass="style7">
Age :</td>
<tdclass="style3">
<asp:TextBoxID="TextBox3"runat="server"></asp:TextBox>
</td>
<tdclass="style3">
<asp:RequiredFieldValidatorID="RequiredFieldValidator3"runat="server"
ControlToValidate="TextBox3"ErrorMessage="Enter
Age"CssClass="style4"></asp:RequiredFieldValidator>
</td>
<tdclass="style3">
<asp:RangeValidatorID="RangeValidator1"runat="server"
ControlToValidate="TextBox3"ErrorMessage="Enter age between 13 and 50"
MaximumValue="50"MinimumValue="13"CssClass="style4"></asp:RangeValidator>
</td>
</tr>
<tr>
<tdclass="style7">
Address :</td>
<tdclass="style3">
<asp:TextBoxID="TextBox6"runat="server"></asp:TextBox>
</td>
<tdclass="style3">
<asp:RequiredFieldValidatorID="RequiredFieldValidator6"runat="server"
ControlToValidate="TextBox6"ErrorMessage="Enter Address"
CssClass="style4"></asp:RequiredFieldValidator>
</td>
<tdclass="style5">
</td>
</tr>
<tr>
<tdclass="style7">
Mobile :</td>
<tdclass="style3">
<asp:TextBoxID="TextBox7"runat="server"></asp:TextBox>
</td>
<tdclass="style3">
<asp:RequiredFieldValidatorID="RequiredFieldValidator7"runat="server"
ControlToValidate="TextBox7"ErrorMessage="Enter Mobile No."
CssClass="style4"></asp:RequiredFieldValidator>
</td>
<tdclass="style3">
<asp:RegularExpressionValidatorID="RegularExpressionValidator2"runat="server"
ControlToValidate="TextBox7"CssClass="style4"
ErrorMessage="Enter 10 digit mobile no."ValidationExpression="^[0-
9]{10}$"></asp:RegularExpressionValidator>
</td>
</tr>
<tr>
<tdclass="style7">
Password :</td>
<tdclass="style3">
<asp:TextBoxID="TextBox4"runat="server"></asp:TextBox>
</td>
<tdclass="style3">
<asp:RequiredFieldValidatorID="RequiredFieldValidator4"runat="server"
ControlToValidate="TextBox4"ErrorMessage="Enter Password"
CssClass="style4"></asp:RequiredFieldValidator>
</td>
<tdclass="style5">
</td>
</tr>
<tr>
<tdclass="style7">
Confirm password :</td>
<tdclass="style3">
<asp:TextBoxID="TextBox5"runat="server"></asp:TextBox>
</td>
<tdclass="style3">
<asp:RequiredFieldValidatorID="RequiredFieldValidator5"runat="server"
ControlToValidate="TextBox5"ErrorMessage="Enter Confirm Password"
CssClass="style4"></asp:RequiredFieldValidator>
</td>
<tdclass="style3">
<asp:CompareValidatorID="CompareValidator1"runat="server"
ControlToCompare="TextBox4"ControlToValidate="TextBox5"
</div>
</form>
</body>
</html>
Form Layout:
Default.aspx:
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="DTH.aspx.cs"
Inherits="DTH" %>
<!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>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:Label ID="Label1" runat="server" Text="DTH SECTION"></asp:Label>
<br />
<br />
<asp:SiteMapPath ID="SiteMapPath1" runat="server">
</asp:SiteMapPath>
</div>
</form>
</body>
</html>
Output:
B Create a web application to demonstrate use of Master Page with applying Styles and Themes
for page beautification.
Masterpage Flow Layout:
MasterPage.Master:
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
<asp:ContentPlaceHolder ID="head" runat="server">
</asp:ContentPlaceHolder>
</head>
<body>
<form id="form1" runat="server">
<div>
<br />
<asp:LinkButton ID="LinkButton1" runat="server"
PostBackUrl="~/WebForm1.aspx">C#</asp:LinkButton>
<asp:LinkButton ID="LinkButton2" runat="server"
PostBackUrl="~/WebForm2.aspx">NS</asp:LinkButton>
<asp:LinkButton ID="LinkButton3" runat="server"
PostBackUrl="~/WebForm3.aspx">ST</asp:LinkButton>
<br />
<br />
<br />
<asp:ContentPlaceHolder ID="ContentPlaceHolder1" runat="server">
</asp:ContentPlaceHolder>
<br />
<br />
<br />
</div>
</form>
</body>
</html>
MasterPage.Master.cs:
Roll No.: 08 Name :Sudarshan Date Page 38
TYBSc(IT)
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
namespace WebApplication1
{
}
}
}
C#.aspx:
NS.aspx:
ST.aspx:
<%@ Page Title="" Language="C#" MasterPageFile="~/Site1.Master" AutoEventWireup="true"
CodeBehind="WebForm3.aspx.cs" Inherits="WebApplication1.WebForm3" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
You Are Viewing Software Testing.
</asp:Content>
Output:
i) GridView:
Form Layout:
Default.aspx:
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False"
DataSourceID="SqlDataSource1">
<Columns>
<asp:BoundField DataField="RollNo" HeaderText="RollNo"
SortExpression="RollNo" />
<asp:BoundField DataField="Name" HeaderText="Name" SortExpression="Name" />
<asp:BoundField DataField="PhoneNo" HeaderText="PhoneNo"
SortExpression="PhoneNo" />
<asp:BoundField DataField="Gender" HeaderText="Gender"
SortExpression="Gender" />
</Columns>
</asp:GridView>
<asp:SqlDataSource ID="SqlDataSource1" runat="server"
ConnectionString="<%$ ConnectionStrings:TYITConnectionString %>"
SelectCommand="SELECT * FROM [tyit] ORDER BY
[Name]"></asp:SqlDataSource>
</div>
</form>
</body>
</html>
Output:
ii) DetailsView
Form Layout:
Default.aspx:-
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs"
Inherits="_Default" %>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<div>
<br />
<asp:Label ID="Label1" runat="server" Text="Enter RollNo"></asp:Label>
<asp:TextBox ID="TxtRlno" runat="server"></asp:TextBox>
<br />
<br />
<asp:Button ID="Button1" runat="server" onclick="Button1_Click"
style="width: 39px" Text="Find" />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<asp:DetailsView ID="DetailsView1" runat="server" Height="50px" Width="125px">
</asp:DetailsView>
<br />
<br />
<br />
</div>
</form>
</body>
</html>
Default.aspx.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;
using System.Data.SqlClient;
}
protected void Button1_Click(object sender, EventArgs e)
{
SqlConnection con = new SqlConnection("Data Source=AYESHA-PC;Initial
Catalog=TYIT;Integrated Security=SSPI");
con.Open();
Label2.Text = "Details of "+TxtRlno.Text+" are as follows";
String query = ("select * from tyit where RollNo =") + TxtRlno.Text;
SqlDataAdapter da = new SqlDataAdapter(query, con);
DataSet ds = new DataSet();
da.Fill(ds);
DetailsView1.DataSource=ds;
DetailsView1.DataBind();
con.Close();
}
}
Output:-
iii) ListView
Form Layout:
Default.aspx:
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs"
Inherits="_Default" %>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<div>
<AlternatingItemTemplate>
<tr style="background-color:#FFF8DC;">
<td>
<asp:Label ID="RollNoLabel" runat="server" Text='<%# Eval("RollNo") %>' />
</td>
<td>
<asp:Label ID="NameLabel" runat="server" Text='<%# Eval("Name") %>' />
</td>
<td>
<asp:Label ID="PhoneNoLabel" runat="server" Text='<%# Eval("PhoneNo") %>' />
</td>
<td>
<asp:Label ID="GenderLabel" runat="server" Text='<%# Eval("Gender") %>' />
</td>
</tr>
</AlternatingItemTemplate>
<EditItemTemplate>
<tr style="background-color:#008A8C;color: #FFFFFF;">
<td>
<asp:Button ID="UpdateButton" runat="server" CommandName="Update"
Text="Update" />
<asp:Button ID="CancelButton" runat="server" CommandName="Cancel"
Text="Cancel" />
</td>
<td>
<asp:TextBox ID="RollNoTextBox" runat="server" Text='<%# Bind("RollNo") %>' />
</td>
<td>
<asp:TextBox ID="NameTextBox" runat="server" Text='<%# Bind("Name") %>' />
</td>
<td>
<asp:TextBox ID="PhoneNoTextBox" runat="server" Text='<%# Bind("PhoneNo") %>'
/>
</td>
<td>
<asp:TextBox ID="GenderTextBox" runat="server" Text='<%# Bind("Gender") %>' />
</td>
</tr>
</EditItemTemplate>
<EmptyDataTemplate>
<table runat="server"
style="background-color: #FFFFFF;border-collapse: collapse;border-color:
#999999;border-style:none;border-width:1px;">
<tr>
<td>
No data was returned.</td>
</tr>
</table>
</EmptyDataTemplate>
<InsertItemTemplate>
<tr style="">
<td>
<asp:Button ID="InsertButton" runat="server" CommandName="Insert"
Text="Insert" />
<asp:Button ID="CancelButton" runat="server" CommandName="Cancel"
Text="Clear" />
</td>
<td>
<asp:TextBox ID="RollNoTextBox" runat="server" Text='<%# Bind("RollNo") %>' />
</td>
<td>
<asp:TextBox ID="NameTextBox" runat="server" Text='<%# Bind("Name") %>' />
</td>
<td>
<asp:TextBox ID="PhoneNoTextBox" runat="server" Text='<%# Bind("PhoneNo") %>'
/>
</td>
<td>
<asp:TextBox ID="GenderTextBox" runat="server" Text='<%# Bind("Gender") %>' />
</td>
</tr>
</InsertItemTemplate>
<ItemTemplate>
<tr style="background-color:#DCDCDC;color: #000000;">
<td>
<asp:Label ID="RollNoLabel" runat="server" Text='<%# Eval("RollNo") %>' />
</td>
<td>
<asp:Label ID="NameLabel" runat="server" Text='<%# Eval("Name") %>' />
</td>
<td>
<asp:Label ID="PhoneNoLabel" runat="server" Text='<%# Eval("PhoneNo") %>' />
</td>
<td>
<asp:Label ID="GenderLabel" runat="server" Text='<%# Eval("Gender") %>' />
</td>
</tr>
</ItemTemplate>
<LayoutTemplate>
<table runat="server">
<tr runat="server">
<td runat="server">
<table ID="itemPlaceholderContainer" runat="server" border="1"
style="background-color: #FFFFFF;border-collapse: collapse;border-
color: #999999;border-style:none;border-width:1px;font-family: Verdana, Arial,
Helvetica, sans-serif;">
<tr runat="server" style="background-color:#DCDCDC;color: #000000;">
<th runat="server">
RollNo</th>
<th runat="server">
Name</th>
<th runat="server">
PhoneNo</th>
<th runat="server">
Gender</th>
</tr>
<tr ID="itemPlaceholder" runat="server">
</tr>
</table>
</td>
</tr>
<tr runat="server">
<td runat="server"
style="text-align: center;background-color: #CCCCCC;font-family:
Verdana, Arial, Helvetica, sans-serif;color: #000000;">
</td>
</tr>
</table>
</LayoutTemplate>
<SelectedItemTemplate>
<tr style="background-color:#008A8C;font-weight: bold;color: #FFFFFF;">
<td>
<asp:Label ID="RollNoLabel" runat="server" Text='<%# Eval("RollNo") %>' />
</td>
<td>
<asp:Label ID="NameLabel" runat="server" Text='<%# Eval("Name") %>' />
</td>
<td>
<asp:Label ID="PhoneNoLabel" runat="server" Text='<%# Eval("PhoneNo") %>' />
</td>
<td>
<asp:Label ID="GenderLabel" runat="server" Text='<%# Eval("Gender") %>' />
</td>
</tr>
</SelectedItemTemplate>
</asp:ListView>
<asp:SqlDataSource ID="SqlDataSource1" runat="server"
ConnectionString="<%$ ConnectionStrings:TYITConnectionString %>"
SelectCommand="SELECT * FROM [tyit]"></asp:SqlDataSource>
</div>
</form>
</body>
</html>
Output:
<htmlxmlns="http://www.w3.org/1999/xhtml">
<headrunat="server">
<title></title>
<styletype="text/css">
.style2
{
width: 100%;
}
.style3
{
width: 143px;
}
</style>
</head>
<body>
<formid="form1"runat="server">
<div>
<br/>
<tableclass="style2">
<tr>
<tdclass="style3">
ID</td>
<tdalign="left"style="width: 308px">
<asp:DropDownListID="DropDownList1"runat="server"
DataSourceID="SqlDataSource1"DataTextField="id"DataValueField="id"
onselectedindexchanged="DropDownList1_SelectedIndexChanged"
AutoPostBack="True">
</asp:DropDownList>
<asp:SqlDataSourceID="SqlDataSource1"runat="server"
ConnectionString="<%$ ConnectionStrings:updatConnectionString3 %>"
SelectCommand="SELECT [id] FROM [harshadmi]"></asp:SqlDataSource>
</td>
<td>
</td>
</tr>
<tr>
<tdclass="style3">
NAME</td>
<tdalign="left"style="width: 308px">
<asp:TextBoxID="TextBox1"runat="server"></asp:TextBox>
</td>
<td>
</td>
</tr>
<tr>
<tdclass="style3">
ADDRESS</td>
<tdalign="left"style="width: 308px">
<asp:TextBoxID="TextBox2"runat="server"></asp:TextBox>
</td>
<td>
</td>
</tr>
<tr>
<tdclass="style3">
MOBILE NO.</td>
<tdalign="left"style="width: 308px">
<asp:TextBoxID="TextBox3"runat="server"></asp:TextBox>
</td>
<td>
</td>
</tr>
</table>
</div>
</form>
</body>
</html>
Disp.aspx.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;
using System.Data.SqlClient;
publicpartialclassDisp : System.Web.UI.Page
{
protectedvoid Page_Load(object sender, EventArgs e)
{
}
protectedvoid DropDownList1_SelectedIndexChanged(object sender, EventArgs e)
{
String serverPath = "Data Source=HARSH;Initial Catalog=updat;Integrated Security=True";
SqlConnection con = newSqlConnection(serverPath);
con.Open();
string qry = "select Name , address , mobile from harshadmi where id=" + DropDownList1.Text + "";
SqlCommand com = newSqlCommand(qry, con);
SqlDataReader dr;
dr = com.ExecuteReader();
while (dr.Read())
{
TextBox1.Text = dr["name"].ToString();
TextBox2.Text = dr["address"].ToString();
TextBox3.Text = dr["mobile"].ToString();
}
dr.Close();
}
}
c. Create a web application for inserting and deleting record from a database. (Using Execute-Non
Query).
Upd.aspx
<%@PageLanguage="C#"AutoEventWireup="true"CodeFile="Upd.aspx.cs"Inherits="validate"%>
<htmlxmlns="http://www.w3.org/1999/xhtml">
<headrunat="server">
<title></title>
<styletype="text/css">
.style1
{
width: 100%;
}
.style2
{
text-align: right;
}
.style3
{
text-align: center;
}
.style4
{
color: #FF0000;
}
.style5
{
text-align: center;
color: #FF0000;
}
.style6
{
text-align: center;
font-size: x-large;
}
.style7
{
text-align: right;
font-weight: bold;
}
</style>
</head>
<body>
<formid="form1"runat="server">
<div>
<tableclass="style1"border="0"cellpadding="3px"cellspacing="0px">
<tr>
<tdclass="style2">
</td>
<tdclass="style3">
</td>
<tdclass="style3">
</td>
<tdclass="style5">
</td>
</tr>
<tr>
<tdclass="style2">
</td>
<tdclass="style6"colspan="2">
<strong>REGISTRATION FORM</strong></td>
<tdclass="style5">
</td>
</tr>
<tr>
<tdclass="style7">
Name :
</td>
<tdclass="style3">
<asp:TextBoxID="TextBox1"runat="server"></asp:TextBox>
</td>
</tr>
<tr>
<tdclass="style7">
Email :</td>
<tdclass="style3">
<asp:TextBoxID="TextBox2"runat="server"></asp:TextBox>
</td>
</tr>
<tr>
<tdclass="style7">
Age :</td>
<tdclass="style3">
<asp:TextBoxID="TextBox3"runat="server"></asp:TextBox>
</td>
</tr>
<tr>
<tdclass="style7">
Address :</td>
<tdclass="style3">
<asp:TextBoxID="TextBox6"runat="server"></asp:TextBox>
</td>
</tr>
<tr>
<tdclass="style7">
Mobile :</td>
<tdclass="style3">
<asp:TextBoxID="TextBox7"runat="server"></asp:TextBox>
</td>
</tr>
<tr>
<tdclass="style7">
Password :</td>
<tdclass="style3">
<asp:TextBoxID="TextBox4"runat="server"TextMode="Password"></asp:TextBox>
</td>
</tr>
<tr>
<tdclass="style7">
Confirm password :</td>
<tdclass="style3">
<asp:TextBoxID="TextBox5"runat="server"TextMode="Password"></asp:TextBox>
</td>
</tr>
<tr>
<tdclass="style7">
</td>
<tdstyle="text-align: center">
<asp:ButtonID="Button1"runat="server"Height="38px"onclick="Button1_Click"
Text="SUBMIT"Width="154px"style="font-weight: 700"/>
</td>
</tr>
<tr>
<td>
</td>
<td>
<asp:LabelID="Label1"runat="server"
style="font-size: x-large; color: #00CC00;"Text="Label"></asp:Label>
</td>
</tr>
<tr>
<tdstyle="text-align: right; font-weight: 700">
Enter ID :</td>
<tdstyle="text-align: center">
<asp:TextBoxID="TextBox8"runat="server"></asp:TextBox>
</td>
</tr>
<tr>
<td>
</td>
<tdstyle="text-align: center">
<asp:ButtonID="Button2"runat="server"Height="32px"onclick="Button2_Click"
style="font-weight: 700"Text="DELETE"Width="131px"/>
</td>
</tr>
<tr>
<td>
</td>
<td>
</td>
<td>
<asp:LabelID="Label2"runat="server"
style="font-size: x-large; color: #00CC00;"Text="Label"></asp:Label>
</td>
<td>
</td>
</tr>
</table>
</div>
</form>
</body>
</html>
Upd.aspx.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;
using System.Data.SqlClient;
publicpartialclassvalidate : System.Web.UI.Page
{
protectedvoid Page_Load(object sender, EventArgs e)
{
Label1.Visible = false;
Label2.Visible = false;
}
protectedvoid Button1_Click(object sender, EventArgs e)
{
String serverPath = "Data Source=HARSH;Initial Catalog=updat;Integrated Security=True";
SqlConnection con = newSqlConnection(serverPath);
con.Open();
String insertQuery = "insert into abc values ('" + TextBox1.Text + "','" + TextBox2.Text + "', '"
+ TextBox3.Text + "','" + TextBox6.Text + "','" + TextBox7.Text + "', '" + TextBox4.Text + "', '"
+ TextBox5.Text + "')";
SqlCommand com = newSqlCommand(insertQuery, con);
com.ExecuteNonQuery();
Label1.Text = "Record Submitted Successfully";
Label1.Visible = true;
}
protectedvoid Button2_Click(object sender, EventArgs e)
{
String serverPath = "Data Source=HARSH;Initial Catalog=updat;Integrated Security=True";
SqlConnection con = newSqlConnection(serverPath);
con.Open();
string qry = "delete from abc where id=" + TextBox8.Text + "";
SqlCommand com = newSqlCommand(qry, con);
com.ExecuteNonQuery();
con.Close();
Label2.Text = "Record Deleted Successfully";
Label2.Visible = true;
}
}
Deleting
<htmlxmlns="http://www.w3.org/1999/xhtml">
<headrunat="server">
<title></title>
<styletype="text/css">
.style1
{
width: 100%;
}
</style>
</head>
<body>
<formid="form1"runat="server">
<div>
<tableclass="style1"border="0"cellpadding="3px"cellspacing="0px">
<tr>
<td>
</td>
<tdcolspan="2"style="text-align: center">
<asp:GridViewID="GridView1"runat="server"CellPadding="4"ForeColor="#333333"
GridLines="None"Height="129px"Width="314px">
<AlternatingRowStyleBackColor="White"/>
<EditRowStyleBackColor="#2461BF"/>
<FooterStyleBackColor="#507CD1"Font-Bold="True"ForeColor="White"/>
<HeaderStyleBackColor="#507CD1"Font-Bold="True"ForeColor="White"/>
<PagerStyleBackColor="#2461BF"ForeColor="White"HorizontalAlign="Center"/>
<RowStyleBackColor="#EFF3FB"/>
<SelectedRowStyleBackColor="#D1DDF1"Font-Bold="True"ForeColor="#333333"/>
<SortedAscendingCellStyleBackColor="#F5F7FB"/>
<SortedAscendingHeaderStyleBackColor="#6D95E1"/>
<SortedDescendingCellStyleBackColor="#E9EBEF"/>
<SortedDescendingHeaderStyleBackColor="#4870BE"/>
</asp:GridView>
</td>
<td>
</td>
</tr>
</table>
</div>
</form>
</body>
</html>
Validate.aspx.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;
using System.Data.SqlClient;
publicpartialclassvalidate : System.Web.UI.Page
{
SqlConnection con = newSqlConnection("Data Source=HARSH;Initial Catalog=updat;Integrated
Security=True");
protectedvoid Page_Load(object sender, EventArgs e)
{
SqlDataAdapter sda = newSqlDataAdapter("select * from abc", con);
DataTable dt = newDataTable();
sda.Fill(dt);
GridView1.DataSource = dt;
GridView1.DataBind();
con.Close();
Label1.Visible = false;
}
}
<htmlxmlns="http://www.w3.org/1999/xhtml">
<headrunat="server">
<title></title>
<styletype="text/css">
.style1
{
width: 100%;
}
</style>
</head>
<body>
<formid="form1"runat="server">
<div>
<tableclass="style1"border="0"cellpadding="3px"cellspacing="0px">
<tr>
<td>
</td>
<tdcolspan="2"style="text-align: center">
<asp:GridViewID="GridView1"runat="server"AllowPaging="True"
AllowSorting="True"AutoGenerateColumns="False"CellPadding="4"
DataKeyNames="id"DataSourceID="SqlDataSource1"ForeColor="#333333"
GridLines="None"Height="129px"PageSize="5"Width="314px">
<AlternatingRowStyleBackColor="White"/>
<Columns>
<asp:CommandFieldShowSelectButton="True"/>
<asp:BoundFieldDataField="id"HeaderText="id"InsertVisible="False"
ReadOnly="True"SortExpression="id"/>
<asp:BoundFieldDataField="name"HeaderText="name"SortExpression="name"/>
<asp:BoundFieldDataField="email"HeaderText="email"SortExpression="email"/>
<asp:BoundFieldDataField="age"HeaderText="age"SortExpression="age"/>
<asp:BoundFieldDataField="address"HeaderText="address"
SortExpression="address"/>
<asp:BoundFieldDataField="mobile"HeaderText="mobile"
SortExpression="mobile"/>
<asp:BoundFieldDataField="psd"HeaderText="psd"SortExpression="psd"/>
<asp:BoundFieldDataField="conpsd"HeaderText="conpsd"
SortExpression="conpsd"/>
<asp:CommandFieldHeaderText="Update"ShowEditButton="True"/>
<asp:CommandFieldHeaderText="Delete"ShowDeleteButton="True"/>
</Columns>
<EditRowStyleBackColor="#2461BF"/>
<FooterStyleBackColor="#507CD1"Font-Bold="True"ForeColor="White"/>
<HeaderStyleBackColor="#507CD1"Font-Bold="True"ForeColor="White"/>
<PagerStyleBackColor="#2461BF"ForeColor="White"HorizontalAlign="Center"/>
<RowStyleBackColor="#EFF3FB"/>
<SelectedRowStyleBackColor="#D1DDF1"Font-Bold="True"ForeColor="#333333"/>
<SortedAscendingCellStyleBackColor="#F5F7FB"/>
<SortedAscendingHeaderStyleBackColor="#6D95E1"/>
<SortedDescendingCellStyleBackColor="#E9EBEF"/>
<SortedDescendingHeaderStyleBackColor="#4870BE"/>
</asp:GridView>
<asp:SqlDataSourceID="SqlDataSource1"runat="server"
ConnectionString="<%$ ConnectionStrings:updatConnectionString %>"
DeleteCommand="DELETE FROM abc where id=@id"
SelectCommand="SELECT * FROM [abc]"
UpdateCommand="UPDATE abc SET name = @name, email = @email, age = @age, address = @address,
mobile = @mobile, psd = @psd, conpsd = @conpsd WHERE (id = @id)">
<DeleteParameters>
<asp:ParameterName="id"/>
</DeleteParameters>
<UpdateParameters>
<asp:ParameterName="name"/>
<asp:ParameterName="email"/>
<asp:ParameterName="age"/>
<asp:ParameterName="address"/>
<asp:ParameterName="mobile"/>
<asp:ParameterName="psd"/>
<asp:ParameterName="conpas"/>
<asp:ParameterName="id"/>
<asp:ParameterName="conpsd"/>
</UpdateParameters>
</asp:SqlDataSource>
</td>
<td>
</td>
</tr>
</table>
</div>
</form>
</body>
</html>
update
Select
Paging
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<div>
Default.aspx.cs:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:ScriptManager ID="ScriptManager1" runat="server">
</asp:ScriptManager>
<asp:Timer ID="Timer1" runat="server" Interval="1000" OnTick="click">
</asp:Timer>
<asp:UpdatePanel ID="UpdatePanel4" runat="server">
<Triggers>
<asp:AsyncPostBackTrigger ControlID="Timer1" EventName="tick" />
</Triggers>
<ContentTemplate>
<asp:Label ID="Label1" runat="server" Text=""></asp:Label>
</ContentTemplate>
</asp:UpdatePanel>
</div>
</form>
</body>
</html>
Default.aspx.cs:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
Output:
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:ScriptManager ID="ScriptManager1" runat="server">
</asp:ScriptManager>
<asp:UpdatePanel ID="UpdatePanel3" runat="server">
<ContentTemplate>
<div style="background-color:#FFFFE0;padding: 20px">
<asp:Label ID="lblTime" runat="server" Font-Bold="True"></asp:Label>
<br /><br />
<asp:Button ID="Button1" runat="server" OnClick="cmdRefreshTime_Click"
Text="Start the Refresh Process" />
</div>
</ContentTemplate>
</asp:UpdatePanel>
<br />
<asp:UpdateProgress ID="updateProgress1" runat="server">
<ProgressTemplate>
<div style="font-size: xx-small">
<asp:Image ID="Image1" runat="server" Height="140px"
ImageUrl="~/Please_wait (1).gif" Width="539px" />
</ProgressTemplate>
</asp:UpdateProgress>
</div>
</form>
</body>
</html>
Default.aspx.cs;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
}
}
Output: