AWDpractical Manual
AWDpractical Manual
1A
step1: create a new project and add a web form .
Solution Explorer>right click on project name>Add>new WebForm
file>ok
Practical No.1C
1.Generate Fibonacci series
Practical No.2B
Design:
Step3: Double click on every button and write a code
Code:
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
public class shape
{
public int x, y, z;
public void getSide(int length, int breadth, int width)
{
x = length;
y = breadth;
z = width;
}
}
public interface IPolygon
{
int calCulateArea();
}
public interface IVolume
{
int getVolume();
}
class Rectangle : shape, IPolygon, IVolume
{
public int calCulateArea()
{
return (x * y);
}
public int getVolume()
{
return (x * y * z);
}
}
namespace P2C
{
public partial class WebForm1 : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
protected void Button1_Click(object sender, EventArgs e)
{
Rectangle r1 = new Rectangle();
int result;
r1.getSide(24, 67, 8);
result = r1.calCulateArea();
Label1.Text = "Area=" + result;
int c;
c = r1.getVolume();
Label2.Text = "Volume=" + c;
}
}
}
Practical No.4A
Step 1: Create Web form
Design:
Step 3: Code
<?xml version="1.0" encoding="utf-8" ?>
<Advertisements>
<Ad>
<ImageUrl>collegeimg.jpg</ImageUrl>
<NavigateUrl>https://sdsmcollege.in/</NavigateUrl>
<Keyword>college</Keyword>
</Ad>
<Ad>
<ImageUrl>Law.jpeg</ImageUrl>
<NavigateUrl>https://sdsmlawcollege.in/</NavigateUrl>
<Keyword>Law college</Keyword>
</Ad>
</Advertisements>
Step4: Run the WebForm.
OUTPUT:
Reload page :
Click on image:
Practical 4C
Step1: Solution Explorer > Add > new item > select web forms user
control > rename it as footer
Step 2: Solution Explorer> Add > new item> web form > create design
> to add footer .ascx file just drag and drop it on your design
Practical no. 5A
Step 1: Solution Explorer>Add>new item>Web form
Design: Toolbox>select each >Menu , SiteMapPath,SiteMapDatasource
Go to WebForm1.aspx >Run
Output:
Practical no.5B
Step 1:to add master page
Solution Explorer>Add>new item>Web forms Master Page
Step 2:to add style sheet
Solution Explorer>Add>new item>Style sheet
Practical no.5C
1) View State
Step 1: Add web form
Step 2:Create Design
Step 3: In source
Code:
Output:
2)Query String
Step 1:Add new Web form
Step 2: Design
Output:
—--------------------------------------------------------------------------------------------
3)Dropdown list
Step 1:Add new Web form
Step 2: Design
Run webForm:
OUTPUT:
—--------------------------------------------------------------------------------------------
4)Application and session state
Step 1:Add new Web form
Step 2: Design
1 button>2 Labels
namespace y5c
{
public class Global : System.Web.HttpApplication
{
protected void Application_Start(object sender, EventArgs e)
{
Application.Add("myax", 0);
}
Code:Webform1.aspx
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
namespace y5c
{
public partial class WebForm1 : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
}
}
Run WebForm
OUTPUT
Practical No. 6A
Step 1:Add new Web form
Step 2: Design
Step3: Double click on button and write a code
Code:WebForm1.aspx.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection.Emit;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
namespace P6A
{
public partial class WebForm1 : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
HttpCookie c1 = new HttpCookie("creator");
c1.Value = "Yash";
Response.Cookies.Add(c1);
String author = Response.Cookies["creator"].Value;
Label1.Text = author;
Response.Cookies["computer"].Expires = DateTime.Now.AddDays(1);
}
if (CheckBoxList1.Items[0].Selected)
Response.Cookies["computer"]["apple"] = "apple";
if (CheckBoxList1.Items[1].Selected)
Response.Cookies["computer"]["dell"] = "dell";
if (CheckBoxList1.Items[2].Selected)
Response.Cookies["computer"]["lenovo"] = "Lenovo";
if (CheckBoxList1.Items[3].Selected)
Response.Cookies["computer"]["acer"] = "acer";
if (CheckBoxList1.Items[4].Selected)
Response.Cookies["computer"]["sony"] = "sony";
if (CheckBoxList1.Items[4].Selected)
Response.Cookies["computer"]["wipro"] = "wipro";
if (Request.Cookies["computer"].Values.ToString() != null)
{
if (Request.Cookies["computer"]["apple"] != null)
if (Request.Cookies["computer"]["dell"] != null)
Label3.Text += Request.Cookies["computer"]["dell"] + "";
if (Request.Cookies["computer"]["lenovo"] != null)
if (Request.Cookies["computer"]["acer"] != null)
if (Request.Cookies["computer"]["sony"] != null)
if (Request.Cookies["computer"]["wipro"] != null)
else
Label3.Text = "Please select your choice";
Response.Cookies["computer"].Expires = DateTime.Now.AddDays(1);
}
}
}
}
OutPut:
Practical No. 6B
Step 1:Add new Web form
Step 2: Design
namespace P6B
{
public partial class WebForm2 : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
if (Session["username"] !=null)
{
Label1.Text = Session["username"].ToString();
}
}
}
}
Output:
Practical No. 7
Step 1:Add new Web form
Step 2: Design
Output:
Practical No. 8
Step 1:Add new Web form
Step 2: Design
in design take scrip manager then update panel in that take one
button and label
then outside update panel take one button and label
Output: