1.
REQUEST
2.
RESPONSE
3.
SERVER
4.
COOKIES
5.
CACHING
6.
SESSION
7.
APPLICATION
REQUEST
REQUEST OBJECT TELL THE CLIENT SIDE
INFORMATION LIKE BROWSER NAME, IP ADDRESS, URL PATH, PAGE INFORMATION ABOUT THE
CLIENT. REQUEST OBJECT REPRESENT ALL INFORMATION OF THE CLIENT SIDE AT SERVER
SIDE.
HTTPREQUEST
IS A CLASS AND REQUEST OBJECT REPRESENT THE
INSTANCE OF THAT CLASS.
SERVER WE USED THE SERVER OBJECT TO REPRESENT THE
SERVER DETAILS ON .NET ENVIRONMENT AND TO REPRESENT THE SERVER INFORMATION
SERVER.MAPPATH();
SERVER.TRANSFER();
SERVER.EXECUTE();
REQUEST FOR FIRST PAGE
|
RESPONSE OF FIRST REQUEST ( RETURN PAGE 1 WITH GET REQUEST)
|
|||||||||||
|
|||||||||||
THAN URL AFTER CHANGING THE URL AGAIN SEND THE
GET REQUEST FOR
THE SECOND PAGE
THAN SERVER TRANSFER THE REQUEST PAGE
EXTRA ROUND TRIPPING IS HERE
DIFFERENCE BETWEEN SERVER .
TRANSFER, SERVER . EXECUTE AND RESPONSE . REDIRECT
RESPONSE
. REDIRECT
1.
THERE IS AN EXTRA
ROUND TRIPPING IN RESPONSE . REDIRECT
2.
IT ALWAYS SEND A
FRESH REQUEST
3.
IT IS QUIT SLOW
4.
IN IT OBJECT IS
DESTROY OF THE CURRENT PAGE AFTER RESPONSE OF THAT REQUEST AND AN NEW OBJECT IS
CREATED FOR THE REQUEST OF THE SECOND PAGE.
5.
HERE URL IS
CHANGED OF EACH SECOND PAGE
SERVER
. TRANSFER
1. EXTRA ROUND TRIPPING IS NOT THERE
2. URL ALSO NOT
CHANGE FOR THE REQUEST OF THE SECOND PAGE, URL IS SAME ONLY SECOND PAGE
ACCORDING THE REQUSET IS SHOWN TO THE CLIENT BROWSER
3. TO OPEN SECOND PAGE OF THE SAME SERVER WE USE THE
SERVER . TRANSFER
4. IN IT WE CAN ACCESS THE OBJECT OF THE FIRST PAGE IN
SECOND PAGE WHERE AS IN RESPONSE . REDIRECT WE NOT ACCESS THE OBJECT OF THE
FIRST PAGE BECAUSE OBJECT HAS BEEN DESTROYES
a. PROCESS OF THE FIRST PAGE IS ALSO STOP WHEN WE USE
THE SERVER .TRANSFER
TO ACCESS WE HAVE TO
USE THE CONTEXT HANDLER PROPERTY.
SERVER . EXECUTE
1. IT IS ALSO
EQUIVALENT TO THE SRVER . TRANSFER
2. HERE IF YOU WANT TO CONTINUE
THE PROCESSING OF THE CURRENT PAGE TO COMPLETE THAN WE USE THE SERVER . EXECUTE
3. IN THIS THE RESPONSE OF THE FIRST PAGE AND SECOND
PAGE PROCESS IS MESSED.
4. IN THIS THE OBJECT OF THE FIRST PAGE IS ALSO
AVILABLE AT THE SECOND PAGE
5. IN THIS THE SECOND PAGE FIRST COMPLETE THE PROCESS
OF FIRST PAGE THAN DO IT OWN PROCESS
CACHING
TO IMPROVE PERFORMANCE EXPENSIVE OUTPUT WHICH IS
PROCESSING AGAIN AND AGAIN, SO WE STORE THEM IN CACHE TO ESCAPE THIS AGAIN AND
AGAIN PROCESSING
FEW COMMANDS TO KNOW INFO ABOUT
BROWSER AND TO WORKING ON REQUEST OBJECT
protected void Page_Load(object
sender, EventArgs e)
{
Response.Write(Request.Browser.Type.ToString());
}
·
IT TELL THE TYPE OF THE BROSER(IE6,IE7,IE8)
protected void Page_Load(object sender, EventArgs
e)
{
string[]
lang = Request.UserLanguages;
foreach
(string s in
lang)
{
Response.Write(s);
}
}
·
TO KNOW THE BROSER LANGUAGE WHICH YOU HAVE SELECTED FOR YOUR BROWSER
To KNOW THAT YOUR BROSER IS SUPPORTING THE JAVA SCRIPT
LANGUAGE OR NOT ( IT ALWAYS RETURN TRUE AND FALSE)
protected void
Page_Load(object sender, EventArgs e)
{
Response.Write(Request.Browser.JavaScript.ToString());
}
Response.Write(Request.PhysicalApplicationPath+"<br/>");
Response.Write(Request.Url.ToString()+"<br/>");
Response.Write(Request.RequestType.ToString()+"<br/>");
//
TO KNOW THE REQUEST TYPE GET OR POST
Response.Write(Request.UserHostAddress+"<br/>");
// TO KNOW THE IP ADDRESS
Response.Write(Request.UserHostName.ToString()+"<br/>");
Response.Write(Request.UserLanguages.ToString()+"<br/>");
Response.Write(Request.UrlReferrer+"<br/>");
// TO KNOW THE ABOUT THE REQUEST
PAGE FROM THIS REQUEST IS COMING
foreach(string s in
Request.Headers)
{
Response.Write(s +"<br/>");
// TO KNOW ALL THE HEADER OF A REQUEST
Response.Write(s +"value ="+ Request.Headers[s] + "<br/>");
// TO PRINT THE VALUE OF EACH HEADER
}
OUTPUT OF THESE COMMANDS
D:\Users\pawan\Documents\Visual
Studio 2008\WebSites\WebSite1\
http://localhost:49160/WebSite1/Default.aspx
GET
127.0.0.1
127.0.0.1
System.String[]
Connection
Connectionvalue =Keep-Alive
Accept
Acceptvalue =*/*
Accept-Encoding
Accept-Encodingvalue =gzip, deflate
Accept-Language
Accept-Languagevalue =en-us
Host
Hostvalue =localhost:49160
User-Agent
User-Agentvalue =Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; WOW64; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0)
http://localhost:49160/WebSite1/Default.aspx
GET
127.0.0.1
127.0.0.1
System.String[]
Connection
Connectionvalue =Keep-Alive
Accept
Acceptvalue =*/*
Accept-Encoding
Accept-Encodingvalue =gzip, deflate
Accept-Language
Accept-Languagevalue =en-us
Host
Hostvalue =localhost:49160
User-Agent
User-Agentvalue =Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; WOW64; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0)
NOTE : CLIENT AND SERVER BOTH ARE
COMMUNICATE TO EACH OTHER WITH THE HELP OF THESE HEADERS INTERNALLY
WORK ON RESPONSE
Response.Write("before
end");
Response.End();
Response.Write("after end");
IT SHOW
ALL RESPONSE CALL BEFORE THE USE OF RESPONSE.END();
OUTPUT: BEFORE END
Response.Write("before CLEAR");
Response.Clear();
Response.Write("after CLEAR");
IT WILL
CLEAR ALL PREVIOUS RESPONSE USED BEFORE RESPONSE . CLEAR
OUTPUT :
AFTER CLEAR
No comments:
Post a Comment