0% found this document useful (0 votes)
20 views9 pages

Awd P5

Uploaded by

dcruzsophia24
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
20 views9 pages

Awd P5

Uploaded by

dcruzsophia24
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 9

PRACTICAL 5A

AIM: Create Web Form to demonstrate use of Website Navigation controls.


Step 1: Create a New ASP.NET Web Forms Project
1. Open Visual Studio.
2. Create a New Project: Select ASP.NET Web Application (.NET Framework) and
click Next.
3. Name Your Project and click Create.

Step 2: Add a SiteMap File


1. Add a New Item: Right-click your project in Solution Explorer, select Add > New
Item.
2. Choose Site Map: Select Site Map and name it Web.sitemap.
Here's a basic example of what you might put in Web.sitemap:

Step 3: Create Web Forms


1. Add New Web Forms: Right-click the project, select Add > New Item..., choose
Web Form, and name it
Default.aspx.
AboutUs.aspx

Contact.aspx.

Step 4: Add Navigation Controls


Open 5a.aspx and add the following code:
PRACTICAL 5B

Aim: Create a web application to demonstrate use of Master Page and content page.
Step 1: Create a New ASP.NET Web Forms Project
1. Open Visual Studio:
o Launch Visual Studio.
2. Create a New Project:
o Go to File > New > Project.
o Select ASP.NET Web Application (.NET Framework).
o Name your project and click Create.
3. Choose a Template:
o In the New ASP.NET Web Application dialog, select Web Forms and click
Create.
Step 2: Add a Site Map File
1. Add a Web.sitemap File:
o Right-click on your project in Solution Explorer.
o Select Add > New Item.
o Choose Site Map from the list and name it Web.sitemap.
o Click Add.
Define Your Site Map:
o Open the Web.sitemap file and define your site map structure.

Step 3: Create Web Forms


1. Add Web Forms:
o Right-click on the project.
o Select Add > New Item.
o Choose Web Form and name it (e.g., Default.aspx).
o Click Add.
o Repeat for other forms (About.aspx, Contact.aspx)
2. Basic Content for Each Page:
o Default.aspx:

o About.aspx (similar structure):


o Contact.aspx:

Step 4: Create a Master Page


1. Add a Master Page:
o Right-click on the project.
o Select Add > New Item.
o Choose Master Page and name it (e.g., Site.master).
o Click Add.
2. Define the Master Page:
o Open Site.master and define the layout:

3. Update Web Forms to Use Master Page:


o Edit each .aspx page to use the master page: MasterPageFile="~/Site1.master"

Step 6: Run Your Application


PRACTICAL 5C
AIM: Create a web application to demonstrate various states of ASP.NET Pages.

Step 1: Create a New ASP.NET Web Forms Project


1. Open Visual Studio.
2. Create a New Project: Select ASP.NET Web Application (.NET Framework) and
click Next.
3. Name Your Project and click Create.

Step 2: Add Web Form for View State, Session State, Application State, and Query
String
1. Right-click the project in Solution Explorer.
2. Select Add > New Item....
3. Select Web Form from the list and name it StateDemo.aspx.
Step 3: View State Example
View State is used to preserve the state of a page and its controls between postbacks.
In StateDemo.aspx, add the following HTML and server controls:
Step 4: Code-Behind for StateDemo.aspx
Now, implement the logic for each state in the code-behind file StateDemo.aspx.cs.
Step 5: Query String Example Page
Next, create another Web Form for demonstrating the Query String. Right-click on the
project, select Add > New Item..., choose Web Form, and name it QueryStringDemo.aspx.
QueryStringDemo.aspx:

QueryStringDemo.aspx.cs:

Step 6: Run the Application

You might also like