Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Is posted back to the server the whole page?

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
Thank you for taking the time.I have two questions
First,can you explain to me what is a Session?
Second,When for example a click event is raised in ASP.NET on client's side,does browser post back to the server the Event message via HTTP POST and the whole page or does it only sends back event message?
If it also sends the page back to the server,can you tell me why?Doesn't that just kill performance?

Thank you very much
 
A Session defines the moment from when a user visits your project page until he leaves (plus a timeout time set by you). As long as his/her browser is on one of your page, and doing some actions, the Session is active.
Therefore you can create variables or execute functions when a user visits, and when he leaves.

c#
//Session on start event on the global.asax file
Session["mySessionVariable"] = "Hello World";

//anywhere in your aspx file
Console.WriteLine(Session["mySessionVariable"].ToString());

Also the Session object contains alot of information of your client.

How the Session really works? Well, it sets a cookie and assigns the variables to it. Until the Session is active, the browser will send to cookie to the client and back (when requested) and will delete it when the user leaves your pages.

ASP.NET doen't only have Sessions (ASP object) but also has a new Cache Object that is similar and can work with or without cookies.

----

teh click button can send a postback to the server and only the event is sent back, therefore performance has increased from normal ASP.

hth
 
I would think so too.But here's a snippet from my book:
'When the click event is raised,the browser handles the client-side event by posting the page to the server.This time,however,an event message is also transmitted to the server.'
What am I missing?

Thank you for helping me
 
Well, the truth is that it does, but it doesn't do is recompile the entire asp page. What the server will do is run the code contained in that event and change only the changed controls, without touching the rest of the page and send it back.
That is alot of time saved.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top