Lab File
Lab File
Lab File
1. HTML Page 2
3. Visual Studio 10
4.1 Swap 12
4.3 Calculator 16
1|Page
Experiment-1
HTML PAGE:
FRAME:
<html>
<frameset rows="200,*">
<frameset cols="200,*">
</frameset>
</html>
<HTML>
<HEAD>
<TITLE>
</TITLE>
</HEAD>
<BODY>
usemap="#planetmap">
<map name="planetmap">
2|Page
<font color="black" align='center'>
</font>
</a>
<hr>
<p align='right'>
</p>
</BODY>
</HTML>
Frame 2:
<HTML>
<HEAD>
<TITLE>
</TITLE>
</HEAD>
<BODY>
<ol>
</ol></BODY>
</HTML>
IMAGE.HTML CODE
<HTML>
<HEAD>
3|Page
<TITLE>
</TITLE>
</HEAD>
<BODY>
</BODY>
</HTML>
IMAGE_SECTION.HTML:
<HTML>
<HEAD>
<TITLE>
</TITLE>
</HEAD>
<BODY>
usemap="#planetmap">
<map name="planetmap">
</map>
<map name="planetmap">
</map>
</BODY>
</HTML>
LIST.HTML CODE:
<HTML>
<HEAD>
4|Page
<TITLE>
</TITLE>
</HEAD>
<BODY>
<font color="red">
<li>Image</li>
<li>Image Section</li>
<li>list</li>
<li>Table</li>
<li>forms</li>
</font>
</ol>
</BODY>
</HTML>
TABLE.HTML
<HTML>
<HEAD>
<TITLE>
</TITLE>
</HEAD>
<BODY>
<TABLE BORDER=4>
<TR>
</TR>
5|Page
<TR>
<TD> 49 </TD>
</TR>
<TR>
<TD> 9 </TD>
</TR>
</TABLE>
</BODY>
</HTML>
FORM.HTML
<HTML>
<TITLE>
EMPLOYEE
</TITLE>
<BODY>
<FORM>
<FIELDSET>
<LEGEND>MY DETAILS:</LEGEND>
</FIELDSET>
</FORM>
</BODY>
</HTML>
FRAME 3:
<HTML>
<HEAD>
<TITLE>
</TITLE>
</HEAD>
<BODY STYLE="BACKGROUND-COLOR:WHITE;">
</BODY>
</HTML>
7|Page
SCREENSHOTS
8|Page
Experiment-2
HTML BASIC TAGS
Tag Description
<!--...--> Defines a comment
<!DOCTYPE> Defines the document type
<a> Defines a hyperlink
<address> Defines contact information for the author/owner of a document
<area> Defines an area inside an image-map
<article> Defines an article
<aside> Defines content aside from the page content
<audio> Defines sound content
<b> Defines bold text
<body> Defines the document's body
<br> Defines a single line break
<button> Defines a clickable button
<caption> Defines a table caption
<col> Specifies column properties for each column within a <colgroup> element
<colgroup> Specifies a group of one or more columns in a table for formatting
<dialog> Defines a dialog box or window
<div> Defines a section in a document
<fieldset> Groups related elements in a form
<figcaption> Defines a caption for a <figure> element
<figure> Specifies self-contained content
<form> Defines an HTML form for user input
<frame> Defines a window (a frame) in a frameset
10 | P a g e
Experiment-3
Visual studio:
Visual Studio is a complete set of development tools for building ASP.NET Web applications, XML Web
Services, desktop applications, and mobile applications. Visual Basic, Visual C#, and Visual C++ all use
the same integrated development environment (IDE), which enables tool sharing and eases the creation of
mixed-language solutions. In addition, these languages use the functionality of the .NET Framework, which
provides access to key technologies that simplify the development of ASP Web applications and XML Web
Services.
Features
Code editor
Debugger
Designer: Visual Studio includes a host of visual designers to aid in the development of
applications. These tools include:
11 | P a g e
Experiment-4
Active Server Page
Swap
Swap.aspx
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="swap.aspx.cs"
Inherits="WebApplication2.swap" %>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<div>
Number1
<asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
Number
2
<asp:TextBox ID="TextBox2" runat="server"></asp:TextBox>
<br />
<asp:Button ID="Button1" runat="server" Text="Swap" OnClick="Button1_Click" />
<br />
Number1 <asp:TextBox ID="TextBox3" runat="server"></asp:TextBox>
Number2
<asp:TextBox ID="TextBox4" runat="server"></asp:TextBox>
</div>
</form>
</body>
</html>
Swap.aspx.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
namespace WebApplication2
{
public partial class swap : System.Web.UI.Page
{
int a, b, c;
protected void Page_Load(object sender, EventArgs e)
{
12 | P a g e
}
Design Webpage
13 | P a g e
Simple Interest
Exercise 1.aspx
<!DOCTYPE html>
<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="Principle"></asp:Label>
<asp:TextBox ID="TextBox1" runat="server" OnTextChanged="TextBox1_TextChanged"
style="margin-left: 56px"></asp:TextBox><br>
<asp:Label ID="Label2" runat="server" Text="Rate"></asp:Label>
<asp:TextBox ID="TextBox2" runat="server" style="margin-left: 75px"
OnTextChanged="TextBox2_TextChanged" Width="111px"></asp:TextBox><br>
<asp:Label ID="Label3" runat="server" Text="time"></asp:Label>
<asp:TextBox ID="TextBox3" runat="server" style="margin-left: 74px"
OnTextChanged="TextBox3_TextChanged"></asp:TextBox>
<br>
<asp:Button ID="Button1" runat="server" Text="Calculate" OnClick="Button1_Click" /><br>
<asp:Label ID="Label4" runat="server" Text="SimpleInterest"></asp:Label>
<asp:TextBox ID="TextBox4" runat="server" style="margin-left: 15px"></asp:TextBox>
</div>
</form>
</body>
</html>
Exercise1.aspx.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
namespace WebApplication1
{
public partial class Exercise1 : System.Web.UI.Page
{
int p, r, t, si;
protected void Page_Load(object sender, EventArgs e)
{
}
protected void TextBox1_TextChanged(object sender, EventArgs e)
{
}
protected void TextBox2_TextChanged(object sender, EventArgs e)
{
}
14 | P a g e
protected void TextBox3_TextChanged(object sender, EventArgs e)
{
}
protected void Button1_Click(object sender, EventArgs e)
{
p = Convert.ToInt32(TextBox1.Text);
r = Convert.ToInt32(TextBox2.Text);
t = Convert.ToInt32(TextBox3.Text);
si = (p*r*t)/100;
TextBox4.Text = Convert.ToString(si);
}
}
}
Webpage
15 | P a g e
Calculator
Exercise2.aspx
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Exercise2.aspx.cs"
Inherits="Exercise2.Exercise2" %>
<!DOCTYPE html>
<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="Num1"></asp:Label>
<asp:TextBox ID="TextBox1" runat="server" style="margin-left: 57px" Width="112px"
OnTextChanged="TextBox1_TextChanged"></asp:TextBox>
<br />
<asp:Label ID="Label2" runat="server" Text="Num2"></asp:Label>
<asp:TextBox ID="TextBox2" runat="server" style="margin-left: 60px"
Width="108px"></asp:TextBox>
<br /> <br />
<asp:Button ID="Button1" runat="server" Text="Add" OnClick="Button1_Click" />
<asp:TextBox ID="TextBox3" runat="server" style="margin-left: 55px"></asp:TextBox>
<br />
<br />
<asp:Button ID="Button2" runat="server" Text="Subtratct" Width="59px"
OnClick="Button2_Click" />
<asp:TextBox ID="TextBox4" runat="server" style="margin-left: 37px"></asp:TextBox>
<br /> <br />
<asp:Button ID="Button3" runat="server" Text="Product" OnClick="Button3_Click" />
<asp:TextBox ID="TextBox5" runat="server" style="margin-left: 26px"></asp:TextBox>
<br /> <br />
<asp:Button ID="Button4" runat="server" Text="Division" OnClick="Button4_Click" />
<asp:TextBox ID="TextBox6" runat="server" style="margin-left: 30px"></asp:TextBox>
<br /> <br />
<asp:Button ID="Button5" runat="server" Text="Modulus" OnClick="Button5_Click" />
<asp:TextBox ID="TextBox7" runat="server"></asp:TextBox>
<br />
<br />
</div>
</form>
</body>
</html>
Exercise2.aspx.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
16 | P a g e
namespace Exercise2
{
public partial class Exercise2 : System.Web.UI.Page
{
int num1, num2, Add, Subtract, Product, Division;
17 | P a g e
18 | P a g e
Fibonacci Series
Exercise3.aspx
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="exercise3.aspx.cs"
Inherits="exercise3.exercise3" %>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:TextBox ID="TextBox3" runat="server"></asp:TextBox>
</div>
</form>
</body>
</html>
Exercise3.aspx.cs
using System;
using System.Activities.Statements;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
namespace FibonacciSeries
{
public partial class WebForm1 : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
do
{
fib = a + b;
a = b;
b = fib;
TextBox2.Text = TextBox2.Text + "," + Convert.ToString(fib) ;
x--;
} while (x>0);
}
}
}
Webpage
20 | P a g e
Square and Cube of Number
WebForm1.aspx
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WebForm1.aspx.cs"
Inherits="WebApplication2.WebForm1" %>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<div>
Enter Number<asp:TextBox ID="TextBox1" runat="server" style="margin-left:
31px"></asp:TextBox>
<br />
<asp:RadioButton ID="RadioButton1" runat="server" BorderStyle="None" Text="Square"
AutoPostBack="True" OnCheckedChanged="RadioButton1_CheckedChanged" GroupName="a"/>
<asp:RadioButton ID="RadioButton2" runat="server"
OnCheckedChanged="RadioButton2_CheckedChanged" Text="Cube" AutoPostBack="True" GroupName="a" />
<br /> <br />
<asp:TextBox ID="TextBox2" runat="server"></asp:TextBox>
</div>
</form>
</body>
</html>
WebForm1.aspx.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
namespace WebApplication2
{
public partial class WebForm1 : System.Web.UI.Page
{
int a, b,c;
protected void Page_Load(object sender, EventArgs e)
{
TextBox2.Visible = false;
}
protected void RadioButton2_CheckedChanged(object sender, EventArgs e)
{
TextBox2.Visible = true;
a = Convert.ToInt32(TextBox1.Text);
c = a * a*a;
TextBox2.Text = Convert.ToString(c);
}
}
}
22 | P a g e
Discount Of different Product
WebForm2.aspx
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WebForm2.aspx.cs"
Inherits="WebApplication2.WebForm2" %>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:RadioButton ID="RadioButton2" runat="server" Text="20"
OnCheckedChanged="RadioButton2_CheckedChanged" AutoPostBack="True" GroupName="a" />
<asp:RadioButton ID="RadioButton3" runat="server" Text="30"
OnCheckedChanged="RadioButton3_CheckedChanged" AutoPostBack="True" GroupName="a" />
<br />
<asp:Button ID="Button1" runat="server" Text="Submit" OnClick="Button1_Click" />
<asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
</div>
</form>
</body>
</html>
WebForm2.aspx.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
23 | P a g e
using System.Web.UI;
using System.Web.UI.WebControls;
namespace WebApplication2
{
public partial class WebForm2 : System.Web.UI.Page
{
int a, b, c, d,h,f,g;
protected void Button1_Click(object sender, EventArgs e)
{
int a;
a = DropDownList1.SelectedIndex;
}
TextBox2.Text = Convert.ToString(DropDownList1.SelectedItem.Value);
}
}
}
WebPage
24 | P a g e
25 | P a g e
Database Connectivity
WEBFORM2.ASPX
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<div>
</div>
<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False"
DataSourceID="SqlDataSource1">
<Columns>
<asp:BoundField DataField="strFirstName" HeaderText="strFirstName"
SortExpression="strFirstName" />
<asp:BoundField DataField="strLastName" HeaderText="strLastName"
SortExpression="strLastName" />
<asp:BoundField DataField="dtmBirthDate" HeaderText="dtmBirthDate"
SortExpression="dtmBirthDate" />
<asp:BoundField DataField="strCity" HeaderText="strCity" SortExpression="strCity"
/>
<asp:BoundField DataField="strCountry" HeaderText="strCountry"
SortExpression="strCountry" />
</Columns>
</asp:GridView>
<asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$
ConnectionStrings:AgeRangeConnectionString %>" ProviderName="<%$
ConnectionStrings:AgeRangeConnectionString.ProviderName %>" SelectCommand="SELECT [strFirstName],
[strLastName], [dtmBirthDate], [strCity], [strCountry] FROM [tblEmployees]"></asp:SqlDataSource>
</form>
</body>
</html>
WEBFORM2.ASPX.CS
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
namespace FibonacciSeries
{
public partial class WebForm2 : System.Web.UI.Page
26 | P a g e
{
protected void Page_Load(object sender, EventArgs e)
{
}
}
}
27 | P a g e