Postback mechanism in asp.net

A

archana

Hi all,

I am new to asp.net i want to ask some help about postback mechanism
of web page.

CAn anyone tell me how postback mechanism is handle by asp.net worker
process. Means why worker process know that this page is posted back
or this page is requested first time. Means which parameter of
httpwebrequest send this information.

If i am wrong please correct me,

thanks in advance.
 
P

Patrice

AFAIK this is jsut the standard HTTP mechanism that is it checks if this is
a GET or POST request... (Request.ServerVariables("HTTP_METHOD") friom the
top of my head). You could use also the "Reflector" tool to check what is
the code being IsPostBack...
 
P

Patrice

AFAIK this is jsut the standard HTTP mechanism that is it checks if this is
a GET or POST request... (Request.ServerVariables("HTTP_METHOD") friom the
top of my head). You could use also the "Reflector" tool to check what is
the code being IsPostBack...
 
A

Aidy

There are two ways to request a page, one is GET and one is POST. When you
enter a url into the address bar, or follow a link it uses GET to just pass
the url and retrieve the html.

When you submit a FORM you can actually specify if the FORM uses GET or
POST. The advantage with POST is that the form data is "hidden" and can be
unlimited in size (there is probably a limit somewhere). Whereas with GET
the form data is on the querystring and is easily seen and updated, and
there is a limit to how long the url can be, so there is a limit to the size
of your data.

You can look in the ServerVariables collection at "REQUEST_METHOD" to see if
you page is being requested via a GET or a POST. When asp.net renders your
page it puts a FORM that uses POST as a method, so when that page is
requested, if it is being POSTd then it knows it is a postback.

I'm sure it doesn't just go on the request method though, with the form will
be certain data that asp.net tests is there to verify it is a genuine
postback.
 
B

bruce barker

asp.net checks if __VIEWSTATE is in the form data to determine if
IsPostback is true.

asp.net pages can use either the get or post method, so thats not a
reliable method. a post means the form data follows the headers, a get
means its contained on the url as args. form data is passed as name
value pairs. the content-type header specifies if there is form data.

-- bruce (sqlwork.com)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top