SlideShare a Scribd company logo
Home.aspx
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="home.aspx.cs"
Inherits="home" %>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
<style type="text/css">
.auto-style1 {
font-size: xx-large;
}
</style></head><body>
<form id="form1" runat="server">
<div class="auto-style1" style="text-align: center">
<strong>HTTP REQUEST &amp; RESPONSE CLASS</strong></div>
<p style="text-align: center">
<asp:HyperLink ID="HyperLink1" runat="server"
NavigateUrl="~/query.aspx">QueryString Collections</asp:HyperLink>
</p>
<p style="text-align: center">
<asp:HyperLink ID="HyperLink2" runat="server"
NavigateUrl="~/browser.aspx">Browser Object</asp:HyperLink>
</p>
<p style="text-align: center">
<asp:HyperLink ID="HyperLink3" runat="server"
NavigateUrl="~/cookies.aspx">Cookies</asp:HyperLink>
</p>
</form></body></html>
Query.aspx
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="query.aspx.cs"
Inherits="query" %>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
<style type="text/css">
.auto-style1 {
font-size: large;
}
</style></head>
<body style="text-align: center">
<form id="form1" runat="server">
<div>
HTTP REQUEST CLASS - QUERY STRING COLLECTION</div>
<p style="text-align: left">
Enter EmpId &amp; Emp.Name in Address bar as given below to process the
QueryString</p>
<p style="text-align: left">
<span style="font-size: 12.0pt; line-height: 115%; font-family: &quot;Times New
Roman&quot;,&quot;serif&quot;; mso-fareast-font-family: Calibri; mso-fareast-theme-font:
minor-latin; background: white; mso-highlight: white; mso-ansi-language: EN-US; mso-
fareast-language: EN-US; mso-bidi-language: AR-SA">Example:
http://LocalHost/***/query.aspx</span><span class="auto-style1" style="line-height: 115%;
font-family: &quot;Times New Roman&quot;,&quot;serif&quot;; mso-fareast-font-family:
Calibri; mso-fareast-theme-font: minor-latin; background: white; mso-highlight: white; mso-
ansi-language: EN-US; mso-fareast-language: EN-US; mso-bidi-language: AR-
SA"><strong><em>?EmpId=10&amp;EmpName=Priya</em></strong></span><asp:Label
ID="EmpId" runat="server" style="z-index: 1; left: 45px; top: 168px; position: absolute;
right: 830px"></asp:Label>
<asp:Label ID="EmpName" runat="server" style="z-index: 1; left: 42px; top: 216px;
position: absolute"></asp:Label>
</p> <p style="text-align: left"> &nbsp;</p>
<p style="text-align: left"> &nbsp;</p>
<p style="text-align: left"> &nbsp;</p>
<p style="text-align: left"> &nbsp;</p>
<p style="text-align: left"> &nbsp;</p>
<p style="text-align: left">
<asp:HyperLink ID="HyperLink1" runat="server" NavigateUrl="~/home.aspx">Go
Home</asp:HyperLink>
</p>
</form></body></html>
Browser.aspx
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="browser.aspx.cs"
Inherits="browser" %>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body style="text-align: center">
<form id="form1" runat="server">
<div>
HTTP REQUEST CLASS - BROWSER OBJECT</div>
<p style="text-align: left">
<strong>BROWSER DETAILS :</strong></p>
<asp:Label ID="BrowserDetails" runat="server" style="z-index: 1; left: 16px; top:
100px; position: absolute"></asp:Label>
<p>
&nbsp;</p>
<p>
&nbsp;</p>
<p>
&nbsp;</p>
<p>
&nbsp;</p>
<p>
<asp:HyperLink ID="HyperLink1" runat="server" NavigateUrl="~/home.aspx"
style="text-align: left; z-index: 1; left: 30px; top: 270px; position: absolute">Go
Home</asp:HyperLink>
</p>
<p>
&nbsp;</p>
</form>
</body>
</html>
Cookies
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="cookies.aspx.cs"
Inherits="cookies" %>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server"> <title></title>
<style type="text/css">
#BodyTag {
text-align: center;
}
</style></head><body runat="server" id="BodyTag">
<form id="form1" runat="server">
<div>
HTTP RESPONSE CLASS - COOKIES</div>
<p style="text-align: left">
Select any color from Dropdown to set as BG color for the next 10 sec.</p>
<p style="text-align: left">
<asp:DropDownList ID="ColorSelector" runat="server" AutoPostBack="True"
OnSelectedIndexChanged="DropDownList1_SelectedIndexChanged">
<asp:ListItem>Select</asp:ListItem>
<asp:ListItem>Red</asp:ListItem>
<asp:ListItem>Blue</asp:ListItem>
<asp:ListItem>Green</asp:ListItem>
<asp:ListItem></asp:ListItem>
</asp:DropDownList>
</p> <p style="text-align: left">
&nbsp;</p> <p style="text-align: left">
&nbsp;</p> <p style="text-align: left">
&nbsp;</p>
<asp:HyperLink ID="HyperLink1" runat="server" NavigateUrl="~/home.aspx">Go
Home</asp:HyperLink>
</form></body></html>
Query.aspx.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
public partial class query : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
EmpId.Text ="Emp.Id :"+ Request.QueryString["EmpId"];
EmpName.Text ="Emp.Name : "+ Request.QueryString["EmpName"];
}
}
Browser.aspx.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
public partial class browser : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
HttpBrowserCapabilities Bcaps;
Bcaps = Request.Browser;
BrowserDetails.Text = "Browser Name : " + Bcaps.Browser + "<br>" +
"Browser Version: " + Bcaps.MajorVersion + "<br>" +
"Support Cookies: " + Bcaps.Cookies + "<br>" +
"Platform : " + Bcaps.Platform + "<br>";
}
}
Cookies.aspx.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
public partial class cookies : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
if (Request.Cookies["BackgroundColor"] != null)
{
ColorSelector.SelectedValue = Request.Cookies["BackgroundColor"].Value;
BodyTag.Style["background-color"] = ColorSelector.SelectedValue;
} }
protected void DropDownList1_SelectedIndexChanged(object sender, EventArgs e)
{
BodyTag.Style["background-color"] = ColorSelector.SelectedValue;
HttpCookie cookie = new HttpCookie("BackgroundColor");
cookie.Value = ColorSelector.SelectedValue;
// cookie.Expires = DateTime.Now.AddHours(1);
cookie.Expires = DateTime.Now.AddSeconds(10);
Response.SetCookie(cookie);
}
}
HTTP REQUEST RESPONSE OBJECT - WEB APPLICATION USING C# LAB
HTTP REQUEST RESPONSE OBJECT - WEB APPLICATION USING C# LAB
HTTP REQUEST RESPONSE OBJECT - WEB APPLICATION USING C# LAB

More Related Content

What's hot (20)

PPT
Asp #1
Joni
 
TXT
Ip lab
Ema Dunphy
 
TXT
Pp checker
Randy Arios
 
PPT
Vb.Net Web Forms
Dutch Dasanaike {LION}
 
PPT
HTML Introduction
Jainul Musani
 
PPT
JavaScript - Part-1
Jainul Musani
 
KEY
Deliverance talk at plone meetup
Jazkarta, Inc.
 
PDF
Practical PHP by example Jan Leth-Kjaer
COMMON Europe
 
PPTX
01. 02. html web engineering html &amp; introduction
N Gull
 
PPTX
Integrating External APIs with WordPress
Marty Thornley
 
PPTX
Consuming & embedding external content in WordPress
Akshay Raje
 
PDF
Turbogears Presentation
didip
 
DOCX
Web technology
Kandarp Tiwari
 
PDF
A Universal Automation Framework based on BDD Cucumber and Ruby on Rails - Ph...
Ho Chi Minh City Software Testing Club
 
PDF
Integrating WordPress With Web APIs
randyhoyt
 
PDF
HTML und CSS für Designer / HTML & CSS for designers (PUBKON 2014)
Michaela Lehr
 
TXT
Makezine
Kelly Thejitternews
 
PDF
oik-plugins: WordUp Pompey! Nov 2011
Herb Miller
 
PDF
BDD with cucumber
Kerry Buckley
 
TXT
Private slideshow
sblackman
 
Asp #1
Joni
 
Ip lab
Ema Dunphy
 
Pp checker
Randy Arios
 
Vb.Net Web Forms
Dutch Dasanaike {LION}
 
HTML Introduction
Jainul Musani
 
JavaScript - Part-1
Jainul Musani
 
Deliverance talk at plone meetup
Jazkarta, Inc.
 
Practical PHP by example Jan Leth-Kjaer
COMMON Europe
 
01. 02. html web engineering html &amp; introduction
N Gull
 
Integrating External APIs with WordPress
Marty Thornley
 
Consuming & embedding external content in WordPress
Akshay Raje
 
Turbogears Presentation
didip
 
Web technology
Kandarp Tiwari
 
A Universal Automation Framework based on BDD Cucumber and Ruby on Rails - Ph...
Ho Chi Minh City Software Testing Club
 
Integrating WordPress With Web APIs
randyhoyt
 
HTML und CSS für Designer / HTML & CSS for designers (PUBKON 2014)
Michaela Lehr
 
oik-plugins: WordUp Pompey! Nov 2011
Herb Miller
 
BDD with cucumber
Kerry Buckley
 
Private slideshow
sblackman
 

Similar to HTTP REQUEST RESPONSE OBJECT - WEB APPLICATION USING C# LAB (20)

PDF
Desenvolvimento web com Ruby on Rails (parte 2)
Joao Lucas Santana
 
PDF
Html server control - ASP. NET with c#
priya Nithya
 
TXT
smoke1272528461
mxsmoketest
 
DOCX
Tercer trabajo de drapi 02
Jhon Silva Penekita
 
TXT
Los Estados De La Materia
Mayritalinda
 
DOC
QuickConnect
Annu G
 
TXT
El Tiempo Nos Ensea 214392
guestc65f09
 
PPTX
JavaServer Pages
profbnk
 
KEY
Fronttechnieken met HTML5 en de Slice-template
Inventis Web Architects
 
TXT
Ss 36932418[1]
Ya Jinda
 
PDF
Mobile themes, QR codes, and shortURLs
Harvard Web Working Group
 
TXT
TURN YOUR CELL PHONE FROM A LIABILITY INTO AN ASSET!
Coulawrence
 
TXT
Frfrfrf
Nelinho Pereira
 
PDF
An Introduction To HTML5
Robert Nyman
 
PPTX
Apex & jQuery Mobile
Christian Rokitta
 
TXT
Schoology tutorial[1]
Rafael Muñoz Espinosa
 
PDF
Django Templates
Willy Liu
 
PDF
HTML5, The Open Web, and what it means for you - Altran
Robert Nyman
 
PDF
Seo Cheat Sheet
Anchal Thakur
 
PDF
Seo cheat-sheet
Elena Michelle
 
Desenvolvimento web com Ruby on Rails (parte 2)
Joao Lucas Santana
 
Html server control - ASP. NET with c#
priya Nithya
 
smoke1272528461
mxsmoketest
 
Tercer trabajo de drapi 02
Jhon Silva Penekita
 
Los Estados De La Materia
Mayritalinda
 
QuickConnect
Annu G
 
El Tiempo Nos Ensea 214392
guestc65f09
 
JavaServer Pages
profbnk
 
Fronttechnieken met HTML5 en de Slice-template
Inventis Web Architects
 
Ss 36932418[1]
Ya Jinda
 
Mobile themes, QR codes, and shortURLs
Harvard Web Working Group
 
TURN YOUR CELL PHONE FROM A LIABILITY INTO AN ASSET!
Coulawrence
 
An Introduction To HTML5
Robert Nyman
 
Apex & jQuery Mobile
Christian Rokitta
 
Schoology tutorial[1]
Rafael Muñoz Espinosa
 
Django Templates
Willy Liu
 
HTML5, The Open Web, and what it means for you - Altran
Robert Nyman
 
Seo Cheat Sheet
Anchal Thakur
 
Seo cheat-sheet
Elena Michelle
 
Ad

More from priya Nithya (17)

PPTX
Android Architecture.pptx
priya Nithya
 
PPTX
Modes of transfer - Computer Organization & Architecture - Nithiyapriya Pasav...
priya Nithya
 
PPTX
Asynchronous data transfer
priya Nithya
 
PDF
Asp.net state management
priya Nithya
 
DOC
Android LAb - Creating an android app with Radio button
priya Nithya
 
PPTX
ASP.NET - Life cycle of asp
priya Nithya
 
DOC
Web application using c# Lab - Web Configuration file
priya Nithya
 
DOCX
Creation of simple application using - step by step
priya Nithya
 
PPSX
Adaptation of tcp window
priya Nithya
 
PPSX
Asp.net Overview
priya Nithya
 
PPSX
Key mechanism of mobile ip
priya Nithya
 
PPSX
Mobile ip overview
priya Nithya
 
PPSX
Features of mobile ip
priya Nithya
 
PDF
Creating a Name seperator Custom Control using C#
priya Nithya
 
PDF
How to Create Database component -Enterprise Application Using C# Lab
priya Nithya
 
PDF
Creating simple component
priya Nithya
 
PPT
Internet (i mcom)
priya Nithya
 
Android Architecture.pptx
priya Nithya
 
Modes of transfer - Computer Organization & Architecture - Nithiyapriya Pasav...
priya Nithya
 
Asynchronous data transfer
priya Nithya
 
Asp.net state management
priya Nithya
 
Android LAb - Creating an android app with Radio button
priya Nithya
 
ASP.NET - Life cycle of asp
priya Nithya
 
Web application using c# Lab - Web Configuration file
priya Nithya
 
Creation of simple application using - step by step
priya Nithya
 
Adaptation of tcp window
priya Nithya
 
Asp.net Overview
priya Nithya
 
Key mechanism of mobile ip
priya Nithya
 
Mobile ip overview
priya Nithya
 
Features of mobile ip
priya Nithya
 
Creating a Name seperator Custom Control using C#
priya Nithya
 
How to Create Database component -Enterprise Application Using C# Lab
priya Nithya
 
Creating simple component
priya Nithya
 
Internet (i mcom)
priya Nithya
 
Ad

Recently uploaded (20)

PPTX
Difference between write and update in odoo 18
Celine George
 
PPTX
How to Create a Customer From Website in Odoo 18.pptx
Celine George
 
PDF
AI-Powered-Visual-Storytelling-for-Nonprofits.pdf
TechSoup
 
PDF
Workbook de Inglés Completo - English Path.pdf
shityouenglishpath
 
PDF
STATEMENT-BY-THE-HON.-MINISTER-FOR-HEALTH-ON-THE-COVID-19-OUTBREAK-AT-UG_revi...
nservice241
 
PDF
IMPORTANT GUIDELINES FOR M.Sc.ZOOLOGY DISSERTATION
raviralanaresh2
 
PDF
Android Programming - Basics of Mobile App, App tools and Android Basics
Kavitha P.V
 
PDF
Reconstruct, Restore, Reimagine: New Perspectives on Stoke Newington’s Histor...
History of Stoke Newington
 
PDF
Governor Josh Stein letter to NC delegation of U.S. House
Mebane Rash
 
PDF
Chapter-V-DED-Entrepreneurship: Institutions Facilitating Entrepreneurship
Dayanand Huded
 
PDF
Week 2 - Irish Natural Heritage Powerpoint.pdf
swainealan
 
PPTX
ENGlish 8 lesson presentation PowerPoint.pptx
marawehsvinetshe
 
PPTX
Controller Request and Response in Odoo18
Celine George
 
PDF
WATERSHED MANAGEMENT CASE STUDIES - ULUGURU MOUNTAINS AND ARVARI RIVERpdf
Ar.Asna
 
PDF
Vani - The Voice of Excellence - Jul 2025 issue
Savipriya Raghavendra
 
PPTX
Introduction to Biochemistry & Cellular Foundations.pptx
marvinnbustamante1
 
PDF
Stokey: A Jewish Village by Rachel Kolsky
History of Stoke Newington
 
PPTX
How to Create Odoo JS Dialog_Popup in Odoo 18
Celine George
 
PPTX
HUMAN RESOURCE MANAGEMENT: RECRUITMENT, SELECTION, PLACEMENT, DEPLOYMENT, TRA...
PRADEEP ABOTHU
 
PPTX
Universal immunization Programme (UIP).pptx
Vishal Chanalia
 
Difference between write and update in odoo 18
Celine George
 
How to Create a Customer From Website in Odoo 18.pptx
Celine George
 
AI-Powered-Visual-Storytelling-for-Nonprofits.pdf
TechSoup
 
Workbook de Inglés Completo - English Path.pdf
shityouenglishpath
 
STATEMENT-BY-THE-HON.-MINISTER-FOR-HEALTH-ON-THE-COVID-19-OUTBREAK-AT-UG_revi...
nservice241
 
IMPORTANT GUIDELINES FOR M.Sc.ZOOLOGY DISSERTATION
raviralanaresh2
 
Android Programming - Basics of Mobile App, App tools and Android Basics
Kavitha P.V
 
Reconstruct, Restore, Reimagine: New Perspectives on Stoke Newington’s Histor...
History of Stoke Newington
 
Governor Josh Stein letter to NC delegation of U.S. House
Mebane Rash
 
Chapter-V-DED-Entrepreneurship: Institutions Facilitating Entrepreneurship
Dayanand Huded
 
Week 2 - Irish Natural Heritage Powerpoint.pdf
swainealan
 
ENGlish 8 lesson presentation PowerPoint.pptx
marawehsvinetshe
 
Controller Request and Response in Odoo18
Celine George
 
WATERSHED MANAGEMENT CASE STUDIES - ULUGURU MOUNTAINS AND ARVARI RIVERpdf
Ar.Asna
 
Vani - The Voice of Excellence - Jul 2025 issue
Savipriya Raghavendra
 
Introduction to Biochemistry & Cellular Foundations.pptx
marvinnbustamante1
 
Stokey: A Jewish Village by Rachel Kolsky
History of Stoke Newington
 
How to Create Odoo JS Dialog_Popup in Odoo 18
Celine George
 
HUMAN RESOURCE MANAGEMENT: RECRUITMENT, SELECTION, PLACEMENT, DEPLOYMENT, TRA...
PRADEEP ABOTHU
 
Universal immunization Programme (UIP).pptx
Vishal Chanalia
 

HTTP REQUEST RESPONSE OBJECT - WEB APPLICATION USING C# LAB

  • 1. Home.aspx <%@ Page Language="C#" AutoEventWireup="true" CodeFile="home.aspx.cs" Inherits="home" %> <!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml"> <head runat="server"> <title></title> <style type="text/css"> .auto-style1 { font-size: xx-large; } </style></head><body> <form id="form1" runat="server"> <div class="auto-style1" style="text-align: center"> <strong>HTTP REQUEST &amp; RESPONSE CLASS</strong></div> <p style="text-align: center"> <asp:HyperLink ID="HyperLink1" runat="server" NavigateUrl="~/query.aspx">QueryString Collections</asp:HyperLink> </p> <p style="text-align: center"> <asp:HyperLink ID="HyperLink2" runat="server" NavigateUrl="~/browser.aspx">Browser Object</asp:HyperLink> </p> <p style="text-align: center"> <asp:HyperLink ID="HyperLink3" runat="server" NavigateUrl="~/cookies.aspx">Cookies</asp:HyperLink> </p> </form></body></html>
  • 2. Query.aspx <%@ Page Language="C#" AutoEventWireup="true" CodeFile="query.aspx.cs" Inherits="query" %> <!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml"> <head runat="server"> <title></title> <style type="text/css"> .auto-style1 { font-size: large; } </style></head> <body style="text-align: center"> <form id="form1" runat="server"> <div> HTTP REQUEST CLASS - QUERY STRING COLLECTION</div> <p style="text-align: left"> Enter EmpId &amp; Emp.Name in Address bar as given below to process the QueryString</p> <p style="text-align: left"> <span style="font-size: 12.0pt; line-height: 115%; font-family: &quot;Times New Roman&quot;,&quot;serif&quot;; mso-fareast-font-family: Calibri; mso-fareast-theme-font: minor-latin; background: white; mso-highlight: white; mso-ansi-language: EN-US; mso- fareast-language: EN-US; mso-bidi-language: AR-SA">Example: http://LocalHost/***/query.aspx</span><span class="auto-style1" style="line-height: 115%; font-family: &quot;Times New Roman&quot;,&quot;serif&quot;; mso-fareast-font-family: Calibri; mso-fareast-theme-font: minor-latin; background: white; mso-highlight: white; mso- ansi-language: EN-US; mso-fareast-language: EN-US; mso-bidi-language: AR- SA"><strong><em>?EmpId=10&amp;EmpName=Priya</em></strong></span><asp:Label ID="EmpId" runat="server" style="z-index: 1; left: 45px; top: 168px; position: absolute; right: 830px"></asp:Label> <asp:Label ID="EmpName" runat="server" style="z-index: 1; left: 42px; top: 216px; position: absolute"></asp:Label> </p> <p style="text-align: left"> &nbsp;</p> <p style="text-align: left"> &nbsp;</p> <p style="text-align: left"> &nbsp;</p> <p style="text-align: left"> &nbsp;</p> <p style="text-align: left"> &nbsp;</p> <p style="text-align: left"> <asp:HyperLink ID="HyperLink1" runat="server" NavigateUrl="~/home.aspx">Go Home</asp:HyperLink> </p> </form></body></html>
  • 3. Browser.aspx <%@ Page Language="C#" AutoEventWireup="true" CodeFile="browser.aspx.cs" Inherits="browser" %> <!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml"> <head runat="server"> <title></title> </head> <body style="text-align: center"> <form id="form1" runat="server"> <div> HTTP REQUEST CLASS - BROWSER OBJECT</div> <p style="text-align: left"> <strong>BROWSER DETAILS :</strong></p> <asp:Label ID="BrowserDetails" runat="server" style="z-index: 1; left: 16px; top: 100px; position: absolute"></asp:Label> <p> &nbsp;</p> <p> &nbsp;</p> <p> &nbsp;</p> <p> &nbsp;</p> <p>
  • 4. <asp:HyperLink ID="HyperLink1" runat="server" NavigateUrl="~/home.aspx" style="text-align: left; z-index: 1; left: 30px; top: 270px; position: absolute">Go Home</asp:HyperLink> </p> <p> &nbsp;</p> </form> </body> </html> Cookies <%@ Page Language="C#" AutoEventWireup="true" CodeFile="cookies.aspx.cs" Inherits="cookies" %> <!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml"> <head runat="server"> <title></title> <style type="text/css"> #BodyTag { text-align: center; } </style></head><body runat="server" id="BodyTag"> <form id="form1" runat="server"> <div> HTTP RESPONSE CLASS - COOKIES</div> <p style="text-align: left"> Select any color from Dropdown to set as BG color for the next 10 sec.</p> <p style="text-align: left"> <asp:DropDownList ID="ColorSelector" runat="server" AutoPostBack="True" OnSelectedIndexChanged="DropDownList1_SelectedIndexChanged"> <asp:ListItem>Select</asp:ListItem>
  • 5. <asp:ListItem>Red</asp:ListItem> <asp:ListItem>Blue</asp:ListItem> <asp:ListItem>Green</asp:ListItem> <asp:ListItem></asp:ListItem> </asp:DropDownList> </p> <p style="text-align: left"> &nbsp;</p> <p style="text-align: left"> &nbsp;</p> <p style="text-align: left"> &nbsp;</p> <asp:HyperLink ID="HyperLink1" runat="server" NavigateUrl="~/home.aspx">Go Home</asp:HyperLink> </form></body></html> Query.aspx.cs using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; public partial class query : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { EmpId.Text ="Emp.Id :"+ Request.QueryString["EmpId"]; EmpName.Text ="Emp.Name : "+ Request.QueryString["EmpName"]; } } Browser.aspx.cs using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI;
  • 6. using System.Web.UI.WebControls; public partial class browser : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { HttpBrowserCapabilities Bcaps; Bcaps = Request.Browser; BrowserDetails.Text = "Browser Name : " + Bcaps.Browser + "<br>" + "Browser Version: " + Bcaps.MajorVersion + "<br>" + "Support Cookies: " + Bcaps.Cookies + "<br>" + "Platform : " + Bcaps.Platform + "<br>"; } } Cookies.aspx.cs using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; public partial class cookies : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { if (Request.Cookies["BackgroundColor"] != null) { ColorSelector.SelectedValue = Request.Cookies["BackgroundColor"].Value; BodyTag.Style["background-color"] = ColorSelector.SelectedValue; } } protected void DropDownList1_SelectedIndexChanged(object sender, EventArgs e) { BodyTag.Style["background-color"] = ColorSelector.SelectedValue; HttpCookie cookie = new HttpCookie("BackgroundColor"); cookie.Value = ColorSelector.SelectedValue; // cookie.Expires = DateTime.Now.AddHours(1); cookie.Expires = DateTime.Now.AddSeconds(10); Response.SetCookie(cookie); } }