Awd P5
Awd P5
Contact.aspx.
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 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: