Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / General / July 2007

Tip: Looking for answers? Try searching our database.

Postback mechanism in asp.net

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
archana - 24 Jul 2007 10:37 GMT
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.
Patrice - 24 Jul 2007 11:56 GMT
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...

--
Patrice

> Hi all,
>
[quoted text clipped - 9 lines]
>
> thanks in advance.
Patrice - 24 Jul 2007 11:56 GMT
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...

--
Patrice

> Hi all,
>
[quoted text clipped - 9 lines]
>
> thanks in advance.
Aidy - 24 Jul 2007 13:08 GMT
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.

> Hi all,
>
[quoted text clipped - 9 lines]
>
> thanks in advance.
bruce barker - 24 Jul 2007 16:53 GMT
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)

> Hi all,
>
[quoted text clipped - 9 lines]
>
> thanks in advance.

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.