Ayush Awp
Ayush Awp
Ayush Awp
Roll No:10
ADVANCE WEB
PROGRAMMING
JOURNAL 2024-2025
1|Page
Ayush Dhumal
Roll No:10
INDEX
Sr.no Topic Date Sign
1 Working with basic C# and ASP.NET
2|Page
Ayush Dhumal
Roll No:10
3|Page
Ayush Dhumal
Roll No:10
Practical No: 1A
Aim: Create an application to print on screen the output of adding, subtracting,
multiplying and dividing two numbers entered by the user.
Source Code:
Default.aspx
<!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>
/><br />
</div>
</form>
4|Page
Ayush Dhumal
Roll No:10
</body>
</html>
Default.aspx.cs
using System; using
System.Collections.Generic; using
using System.Web.UI;
using System.Web.UI.WebControls;
Convert.ToInt32(TextBox1.Text) / Convert.ToInt32(TextBox2.Text);
5|Page
Ayush Dhumal
Roll No:10
Output:
6|Page
Ayush Dhumal
Roll No:10
Practical No: 1B
Aim: Create an application to demonstrate following operations.
2) Prime Number.
Source Code:
1) Generate Fibonacci Series.
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>
<div>
</div>
7|Page
Ayush Dhumal
Roll No:10
</form>
</body>
</html>
Default.aspx.cs
using System; using
System.Collections.Generic; using
using System.Web.UI;
using System.Web.UI.WebControls;
{ int a, b, c, i, n; a =
0; b = 1;
n = Convert.ToInt32(TextBox1.Text);
c = a + b;
8|Page
Ayush Dhumal
Roll No:10
a = b; b = c;
Output:
9|Page
Ayush Dhumal
Roll No:10
2) Prime Number.
Source Code:
Default.aspx
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default2.aspx.cs" Inherits="Default2"
%>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<div>
</div>
</form>
</body>
</html>
10 | P a g e
Ayush Dhumal
Roll No:10
Default.aspx.cs
using System; using
System.Collections.Generic; using
using System.Web.UI;
using System.Web.UI.WebControls;
{ int n, i, s = 0;
n = Convert.ToInt32(TextBox1.Text);
if (n == 0 || n == 1) s = 1; for (i = 2; i
<= n / 2; i++)
if (n % i == 0)
s = 1;
break;
11 | P a g e
Ayush Dhumal
Roll No:10
if (s == 0)
else
Output:
12 | P a g e
Ayush Dhumal
Roll No:10
13 | P a g e
Ayush Dhumal
Roll No:10
Practical No: 2
Aim: Create a simple web page with various server controls to
demonstrate setting and use of their properties.(Example : AutoPostBack)
Source Code:
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>
<div>
/>
14 | P a g e
Ayush Dhumal
Roll No:10
</div>
</form>
</body>
</html>
15 | P a g e
Ayush Dhumal
Roll No:10
Default.aspx.cs
using System; using
System.Collections.Generic; using
using System.Web.UI;
using System.Web.UI.WebControls;
== true)
(CheckBox2.Checked == true)
16 | P a g e
Ayush Dhumal
Roll No:10
(CheckBox3.Checked == true)
(CheckBox4.Checked == true)
(CheckBox5.Checked == true)
TextBox1.Text = "";
TextBox2.Text = "";
TextBox3.Text = "";
TextBox4.Text = "";
TextBox5.Text = "";
CheckBox1.Checked = false;
CheckBox2.Checked = false;
CheckBox3.Checked = false;
CheckBox4.Checked = false;
CheckBox5.Checked = false;
Label1.Text = "";
17 | P a g e
Ayush Dhumal
Roll No:10
18 | P a g e
Ayush Dhumal
Roll No:10
Output:
19 | P a g e
Ayush Dhumal
Roll No:10
Practical No: 3A
Working with form Controls
Pract 4 A)
Aim : Create a Registration form to demonstrate use of various Validation
Controls.
Source Code:
Deafult.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>
<div>
20 | P a g e
Ayush Dhumal
Roll No:10
21 | P a g e
Ayush Dhumal
Roll No:10
</div>
</form>
</body>
</html>
OUTPUT:
22 | P a g e
Ayush Dhumal
Roll No:10
Practical No: 3B
Aim: Create Web Form to demonstrate use of Adrotator Control Source
Code:
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>
<div>
</asp:ScriptManager>
</asp:Timer>
<Triggers>
</Triggers>
23 | P a g e
Ayush Dhumal
Roll No:10
<ContentTemplate>
</ContentTemplate>
</asp:UpdatePanel>
</div>
</form>
</body>
</html>
XMLFile.xml
<?xml version="1.0" encoding="utf-8" ?>
<Advertisements>
<Ad>
<ImageUrl>~/image/google.jpeg</ImageUrl>
<NavigateUrl>http://www.google.com</NavigateUrl>
<AlternateText>
</AlternateText>
</Ad>
<Ad>
<ImageUrl>~/image/facebook.jpeg</ImageUrl>
<NavigateUrl>http://www.facebook.com</NavigateUrl>
<AlternateText>
24 | P a g e
Ayush Dhumal
Roll No:10
</AlternateText>
</Ad>
<Ad>
<ImageUrl>~/image/whatsapp.jpeg</ImageUrl>
<NavigateUrl>http://www.whatsapp.com</NavigateUrl>
<AlternateText>
</AlternateText>
</Ad>
</Advertisements>
25 | P a g e
Ayush Dhumal
Roll No:10
OUTPUT:
26 | P a g e
Ayush Dhumal
Roll No:10
Practical No: 4A
Aim: Create a web application to demonstrate use of Master Page with applying
Style and themes for page beautification.
->Create a Master page
Source Code:
MasterPage.master
Home.aspx
<%@ Page Title="" Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true"
CodeFile="Home.aspx.cs" Inherits="Home" %>
</asp:Content>
<h2>Fort,Mumbai
400006</h2>
</asp:Content>
27 | P a g e
Ayush Dhumal
Roll No:10
Registration.aspx
<%@ Page Title="" Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true"
CodeFile="Registration.aspx.cs" Inherits="Registration" %>
</asp:Content>
<h1>Registration Form</h1>
</asp:Content>
Login.aspx
<%@ Page Title="" Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true"
CodeFile="Login.aspx.cs" Inherits="Login" %>
</asp:Content>
28 | P a g e
Ayush Dhumal
Roll No:10
</asp:Content>
AboutUs.aspx
<%@ Page Title="" Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true"
CodeFile="AboutUs.aspx.cs" Inherits="AboutUs" %>
</asp:Content>
<h3>Introduction:</h3>
<p>Siddharth College of Commerce and Economics, established in 1953, recognized under Sections
2(f) and 12 (B) of the UGC Act is one of the premier affiliated Colleges of the University of Mumbai.
Our College was the first Commerce College started by the People's Education Society and is the second
oldest Commerce College in Mumbai.
The College is situated in South Mumbai which is the financial heart of Mumbai and India.
Institutions like the RBI Headquarters, the Bombay Stock Exchange and the head offices of many
nationalized banks,
<u>The College building, Anand Bhavan (formerly Albert Building) is a Grade II Heritage structure.
The built-in area includes the College office the offices of the Self-financed Programmes, the library, 3
computer labs, the Examination department,
the NCC, NSS and Gymkhana rooms, the Principal's cabin, Professors' Common Room, 14 other class
roooms and 1 small room for tutorials as well as
29 | P a g e
Ayush Dhumal
Roll No:10
the Ph.D. Research Centre. The library lends itself to a quiet and reflective ambience for the students as
well as the faculty members.
It is well-stocked with books. Besides this, the College also has 8 additional classrooms and one Staff
Room in Municipal School Building,
<b>The College provides proper guidance to the students not only to help them choose the right career
path,
but also to help them in becoming confident and emotionally secure individuals. The College is
committed to making students conscious
of their social responsibility through outreach programmes organized by NSS and NCC which enhance
students' social awareness and sensitivity
towards the upliftment of the underprivileged sections of the society. It also helps them discover hidden
talents through sports and cultural activities.</b>
</asp:Content>
30 | P a g e
Ayush Dhumal
Roll No:10
StyleSheet.css
body
background-color:Gray;
background-image:url(clg.jpg) }
font-size:medium; text-
family:Arial; font-size:medium; }
p{ color:Green; } b{ color:Orange;
SkinFile.skin
<%--
Default skin template. The following skins are provided as examples only.
duplicate SkinId's per control type are not allowed in the same theme.
</asp:GridView>
31 | P a g e
Ayush Dhumal
Roll No:10
2. Default skin. The SkinId is not defined. Only one default control skin
--%>
Output:
32 | P a g e
Ayush Dhumal
Roll No:10
33 | P a g e
Ayush Dhumal
Roll No:10
Practical No: 4B
Aim : Create a web application to demonstrate various States of ASP.NET pages.
Source Code:
1) ViewState:
Default.aspx
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="viewstate" %>
34 | P a g e
Ayush Dhumal
Roll No:10
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<div>
/>
</div>
</form>
</body>
</html>
Default.aspx.cs
using System; using
System.Collections.Generic; using
using System.Web.UI;
using System.Web.UI.WebControls;
35 | P a g e
Ayush Dhumal
Roll No:10
if (!IsPostBack)
(ViewState["name"] == null)
ViewState["name"] = str;
Label1.Text = ViewState["name"].ToString();
OUTPUT:
36 | P a g e
Ayush Dhumal
Roll No:10
2) Cookies
Cookies.aspx
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Cookies.aspx.cs" Inherits="Default2" %>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
37 | P a g e
Ayush Dhumal
Roll No:10
<div>
onselectedindexchanged="DropDownList1_SelectedIndexChanged">
<asp:ListItem Value="Red">Red</asp:ListItem>
<asp:ListItem Value="Green">Green</asp:ListItem>
<asp:ListItem Value="Yellow">Yellow</asp:ListItem>
<asp:ListItem Value="Pink">Pink</asp:ListItem>
<asp:ListItem Value="Orange">Orange</asp:ListItem>
<asp:ListItem Value="Blue">Blue</asp:ListItem>
</asp:DropDownList>
</div>
</form>
</body>
</html>
Cookies.aspx.cs
using System; using
System.Collections.Generic; using
using System.Web.UI;
using System.Web.UI.WebControls;
38 | P a g e
Ayush Dhumal
Roll No:10
if (!IsPostBack)
if (Request.Cookies["BackgroundColor"] != null)
DropDownList1.SelectedValue = Request.Cookies["BackgroundColor"].Value;
BodyTag.Style["background-color"] = DropDownList1.SelectedValue;
BodyTag.Style["background-color"] = DropDownList1.SelectedValue;
HttpCookie("BackgroundColor"); cookie.Value =
DropDownList1.SelectedValue; cookie.Expires =
DateTime.Now.AddMilliseconds(5);
Response.Cookies.Add(cookie);
Response.SetCookie(cookie);
39 | P a g e
Ayush Dhumal
Roll No:10
OUTPUT:
3) Querystring
Querystring.aspx
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Querystring.aspx.cs"
Inherits="Querystring" %>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
40 | P a g e
Ayush Dhumal
Roll No:10
<title></title>
</head>
<body>
<div>
</div>
</form>
</body>
</html>
Querystring.aspx.cs
using System; using
System.Collections.Generic; using
using System.Web.UI;
using System.Web.UI.WebControls;
41 | P a g e
Ayush Dhumal
Roll No:10
Default2.aspx
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default2.aspx.cs" Inherits="Default2" %>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<div>
</div>
42 | P a g e
Ayush Dhumal
Roll No:10
</form>
</body>
</html>
Default2.aspx.cs
using System; using
System.Collections.Generic; using
using System.Web.UI;
using System.Web.UI.WebControls;
if (!IsPostBack)
Label1.Text = Request.QueryString["UserId"];
Label2.Text = Request.QueryString["Password"];
43 | P a g e
Ayush Dhumal
Roll No:10
OUTPUT:
44 | P a g e
Ayush Dhumal
Roll No:10
Golbal.aspx
<%@ Application Language="C#" %>
sender, EventArgs e)
Application["user"] = 0;
Application.Lock();
45 | P a g e
Ayush Dhumal
Roll No:10
Application["user"] = (int)Application["user"] + 1;
Application.UnLock();
Application.Lock();
Application["user"] = (int)Application["user"] - 1;
Application.UnLock();
</script>
Web.Config
<?xml version="1.0"?>
<!--
For more information on how to configure your ASP.NET application, please visit
http://go.microsoft.com/fwlink/?LinkId=169433
-->
<configuration>
<system.web>
</system.web>
</configuration>
46 | P a g e
Ayush Dhumal
Roll No:10
SessionApplicationt.aspx
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="SessionApplication.aspx.cs"
Inherits="SessionApplication" %>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<div>
</div>
47 | P a g e
Ayush Dhumal
Roll No:10
</form>
</body>
</html>
OUTPUT:
48 | P a g e
Ayush Dhumal
Roll No:10
Practical No: 5A
Aim: Create a web application bind data in a multiline textbox by querying in
another textbox.
Source Code:
Default.aspx
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>
49 | P a g e
Ayush Dhumal
Roll No:10
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<div>
</div>
</form>
</body>
</html>
Default.aspx.cs
using System; using
System.Collections.Generic; using
System.Web.UI.WebControls; using
50 | P a g e
Ayush Dhumal
Roll No:10
System.Data.SqlClient; using
System.Configuration; using
System.Data;
SqlDataReader r = cmd.ExecuteReader();
while (r.Read())
TextBox2.Text += Environment.NewLine;
TextBox2.Text += r[i].ToString().PadRight(10);
51 | P a g e
Ayush Dhumal
Roll No:10
r.Close();
con.Close();
Web.Config
<?xml version="1.0"?>
<!--
For more information on how to configure your ASP.NET application, please visit
http://go.microsoft.com/fwlink/?LinkId=169433
-->
<configuration>
<system.web>
</system.web>
<connectionStrings>
52 | P a g e
Ayush Dhumal
Roll No:10
providerName="System.Data.SqlClient" />
</connectionStrings>
</configuration>
53 | P a g e
Ayush Dhumal
Roll No:10
OUTPUT:
54 | P a g e
Ayush Dhumal
Roll No:10
Practical No: 5B
Aim: create an application to display records by using Database.
Source Code:
Default.aspx
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default3.aspx.cs" Inherits="Default3"
%>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<div>
</div>
</form>
</body>
</html>
55 | P a g e
Ayush Dhumal
Roll No:10
Default.aspx.cs
using System; using
System.Collections.Generic; using
System.Web.UI.WebControls; using
System.Data; using
System.Data.SqlClient; using
System.Configuration;
con.Open();
56 | P a g e
Ayush Dhumal
Roll No:10
SqlDataReader r = cmd.ExecuteReader();
while (r.Read())
r.Close();
con.Close();
57 | P a g e
Ayush Dhumal
Roll No:10
Web.Config
<?xml version="1.0"?>
<!--
For more information on how to configure your ASP.NET application, please visit
http://go.microsoft.com/fwlink/?LinkId=169433
-->
<configuration>
<system.web>
</system.web>
<connectionStrings>
providerName="System.Data.SqlClient" />
</connectionStrings>
</configuration>
58 | P a g e
Ayush Dhumal
Roll No:10
OUTPUT:
59 | P a g e
Ayush Dhumal
Roll No:10
Practical No: 5C
Aim: Demonstrate the use of DataList link Control
Steps:
Source Code:
Default.aspx
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default2.aspx.cs" Inherits="Default2" %>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<div>
60 | P a g e
Ayush Dhumal
Roll No:10
<ItemTemplate>
Id:
<br />
Name:
<br />
Age:
<br />
Address:
<br />
<br />
</ItemTemplate>
</asp:DataList>
</div>
</form>
</body>
</html>
61 | P a g e
Ayush Dhumal
Roll No:10
62 | P a g e
Ayush Dhumal
Roll No:10
63 | P a g e
Ayush Dhumal
Roll No:10
64 | P a g e
Ayush Dhumal
Roll No:10
OUTPUT:
65 | P a g e
Ayush Dhumal
Roll No:10
Practical No: 6A
Aim: Create a simple web page with various server controls to
demonstrate setting and use of their properties.(Example : AutoPostBack)
Source Code:
Default.aspx
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<div>
</div>
</form>
</body>
66 | P a g e
Ayush Dhumal
Roll No:10
</html>
Default.aspx.cs
System.Collections.Generic; using
System.Web.UI.WebControls; using
System.Configuration; using
System.Data;
using System.Data.SqlClient;
if (IsPostBack == false)
SqlDataReader r = cmd.ExecuteReader();
DropDownList1.DataSource = r;
67 | P a g e
Ayush Dhumal
Roll No:10
DropDownList1.DataTextField = "city";
DropDownList1.DataBind();
r.Close();
con.Close();
Web.config
<?xml version="1.0"?>
<!--
For more information on how to configure your ASP.NET application, please visit
http://go.microsoft.com/fwlink/?LinkId=169433
-->
<configuration>
68 | P a g e
Ayush Dhumal
Roll No:10
<system.web>
</system.web>
<connectionStrings>
</connectionStrings>
</configuration>
Output:-
69 | P a g e
Ayush Dhumal
Roll No:10
Practical No: 6B
Aim: Create a simple web page with various server controls to
demonstrate setting and use of their properties.(Example : AutoPostBack)
Source Code:
Default.aspx
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<div>
</div>
</form>
</body>
</html>
70 | P a g e
Ayush Dhumal
Roll No:10
Default.aspx.cs
System.Collections.Generic; using
System.Web.UI.WebControls; using
System.Configuration; using
System.Data;
using System.Data.SqlClient;
if (IsPostBack == false)
SqlDataReader r = cmd.ExecuteReader();
DropDownList1.DataSource = r;
DropDownList1.DataValueField = "city";
71 | P a g e
Ayush Dhumal
Roll No:10
DropDownList1.DataTextField = "name";
DropDownList1.DataBind();
r.Close();
con.Close();
Web.config
<?xml version="1.0"?>
<!--
For more information on how to configure your ASP.NET application, please visit
http://go.microsoft.com/fwlink/?LinkId=169433
-->
<configuration>
<system.web>
</system.web>
<connectionStrings>
72 | P a g e
Ayush Dhumal
Roll No:10
</connectionStrings>
</configuration>
Output:-
73 | P a g e
Ayush Dhumal
Roll No:10
Practical No: 7A
Aim: Web Application to display data using Disconnected Data Access and
Data Binding using GridView control Source Code:
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>
<div>
GridLines="Horizontal">
74 | P a g e
Ayush Dhumal
Roll No:10
</asp:GridView>
</div>
</form>
</body>
</html>
Default.aspx.cs
using System;
using System.Collections.Generic;
using System.Web.UI.WebControls;
using System.Configuration;
using System.Data;
using System.Data.SqlClient;
75 | P a g e
Ayush Dhumal
Roll No:10
"CustomerCopy");
GridView1.DataSource = ds.Tables[0];
GridView1.DataBind();
Web.config
<?xml version="1.0"?>
<!--
For more information on how to configure your ASP.NET application, please visit http://go.microsoft.com/fwlink/?
LinkId=169433
-->
<configuration>
<system.web>
76 | P a g e
Ayush Dhumal
Roll No:10
</system.web>
<connectionStrings>
</connectionStrings>
</configuration>
OUTPUT:
77 | P a g e
Ayush Dhumal
Roll No:10
Practical No: 7B
Aim: Web Application to display data using Disconnected Data Access and
Data Binding using FormView control Source Code:
Default.aspx
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default2.aspx.cs" Inherits="Default" %>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<div>
<EditItemTemplate>
id:
<br />
name:
<br />
mobile_no:
78 | P a g e
Ayush Dhumal
Roll No:10
<br />
city:
<br />
state:
<br />
country:
<br />
</EditItemTemplate>
<InsertItemTemplate>
id:
<br />
name:
<br />
mobile_no:
city:
79 | P a g e
Ayush Dhumal
Roll No:10
<br />
state:
<br />
country:
<br />
</InsertItemTemplate>
<ItemTemplate>
id:
<br />
name:
<br />
mobile_no:
<br />
city:
<br />
state:
80 | P a g e
Ayush Dhumal
Roll No:10
<br />
country:
<br />
</ItemTemplate>
</asp:FormView>
</div>
</form>
</body>
</html>
Next->
81 | P a g e
Ayush Dhumal
Roll No:10
82 | P a g e
Ayush Dhumal
Roll No:10
83 | P a g e
Ayush Dhumal
Roll No:10
OUTPUT:-
84 | P a g e
Ayush Dhumal
Roll No:10
Practical No: 7C
Aim: Web Application to display data using Disconnected Data Access and
Data Binding using DetailView control Source Code:
Default.aspx
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<div>
AutoGenerateRows="False" DataSourceID="SqlDataSource1">
<Fields>
SortExpression="mobile_no" />
SortExpression="country" />
85 | P a g e
Ayush Dhumal
Roll No:10
</Fields>
</asp:DetailsView>
</div>
</form>
</body>
</html>
86 | P a g e
Ayush Dhumal
Roll No:10
87 | P a g e
Ayush Dhumal
Roll No:10
OUTPUT:-
88 | P a g e
Ayush Dhumal
Roll No:10
Practical No: 8A
Aim: Create a web application to demonstrate from security and windows security
with proper authentication and authorization properties.
Source Code:
Default1.aspx
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default1.aspx.cs" Inherits="Default1" %>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<div>
<asp:CheckBox ID="CheckBox1" runat="server" Text="check thios if itr your personal computer"/><br /><br />
</div>
</form>
</body>
89 | P a g e
Ayush Dhumal
Roll No:10
</html>
Default1.aspx.cs
using System;
System.Web.UI; using
System.Web.UI.WebControls; using
Default1 : System.Web.UI.Page
if(uname == "Sanket")
{
if (pass == "123")
return true;
if (uname == "Lavesh")
{
if (pass == "456")
return true;
if (uname == "Ayush")
90 | P a g e
Ayush Dhumal
Roll No:10
if (pass == "789")
return true;
}
if (uname == "Shubham")
if (pass == "shu123")
return true;
}
if (uname == "Sanchin")
if (pass == "91123")
return true;
}
return false;
{
if (authenticate(TextBox1.Text, TextBox2.Text))
FormsAuthentication.RedirectFromLoginPage(TextBox1.Text, CheckBox1.Checked);
Session["username"] = TextBox1.Text;
Response.Redirect("Default2.aspx");
}
else
}
Default2.aspx
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default2.aspx.cs" Inherits="Default2" %>
91 | P a g e
Ayush Dhumal
Roll No:10
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<div>
</div>
</form>
</body>
</html>
92 | P a g e
Ayush Dhumal
Roll No:10
Default2.aspx.cs
using System;
using
System.Collections.Generic;
System.Web; using
System.Web.UI;
using System.Web.UI.WebControls;
if (Session["username"] !=null)
93 | P a g e
Ayush Dhumal
Roll No:10
Web.config
<?xml version="1.0"?>
<!--
For more information on how to configure your ASP.NET application, please visit http://go.microsoft.com/fwlink/?
LinkId=169433
-->
<configuration>
<system.web>
<authentication mode="Forms">
</forms>
</authentication>
<authorization>
<allow users="?"/>
<deny users="?"/>
</authorization>
</system.web>
</configuration>
94 | P a g e
Ayush Dhumal
Roll No:10
95 | P a g e
Ayush Dhumal
Roll No:10
OUTPUT:
Practical No: 8B
Aim: create a web application to demonstrate use of various Ajax Controls.
Source Code:
Default.aspx
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<div>
96 | P a g e
Ayush Dhumal
Roll No:10
</div>
</form>
</body>
</html>
OUTPUT:
97 | P a g e
Ayush Dhumal
Roll No:10
Practical No : 9
Aim: Program to create and use DLL.
Steps:
In Visual Studio -> file -> new -> Project -> select Class Library
Source Code:
ClassLibrary2.Class1
using System; using
System.Collections.Generic; using
namespace ClassLibrary2
98 | P a g e
Ayush Dhumal
Roll No:10
return text.ToUpper();
return text.ToLower();
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>
<div>
99 | P a g e
Ayush Dhumal
Roll No:10
</div>
</form>
</body>
</html>
TextBox1.Text = t.UpperConvert(TextBox1.Text);
100 | P a g e
Ayush Dhumal
Roll No:10
TextBox1.Text = t.LowerConvert(TextBox1.Text);
101 | P a g e
Ayush Dhumal
Roll No:10
OUTPUT:
102 | P a g e
Ayush Dhumal
Roll No:10
Practical No : 10
Aim: Create a web application for User defined exception handling.
Source Code:
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>
/><br />
</div>
</form>
</body>
</html>
103 | P a g e
Ayush Dhumal
Roll No:10
Default.aspx.cs
using System; using
System.Collections.Generic; using
using System.Web.UI;
using System.Web.UI.WebControls;
try
decimal a, b, result; a =
Decimal.Parse(TextBox1.Text); b =
Decimal.Parse(TextBox2.Text);
result = a / b;
Label1.Text = result.ToString();
Label1.ForeColor = System.Drawing.Color.Black;
104 | P a g e
Ayush Dhumal
Roll No:10
Label1.Text += "<br/>";
Label1.Text += "<br/>";
Label1.ForeColor = System.Drawing.Color.Red;
OUTPUT:
105 | P a g e
Ayush Dhumal
Roll No:10
106 | P a g e