Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Difference between Page refresh and Page postback

Tags:

asp.net

My question is - what is the difference between page refresh (if I press f5) and postback (If I press a button)?

Can anyone please tell me?

Thanks in advance.

like image 421
Mohit Kumar Avatar asked May 19 '10 10:05

Mohit Kumar


2 Answers

A refresh mean a complete reload of the page, without any form data. This is essentially an HTTP GET.

A post back is when the page is posted to itself (through the form action=""). This is essentially an HTTP POST.

like image 178
Oded Avatar answered Oct 17 '22 22:10

Oded


Lets have the actual difference between refresh and explicitily submitting a page :

1) Refresh does not mean to post back the page with get method..(You can check it with response.write request.form("some input type")).

2)Difference lies with the data sent to the server : in case of explicit submit form is submitted with latest value(i.e it recognize the changes in form elements) But in case of refresh, form is submitted with default form value.(i.e if you change the value of form element it will not reflect at server.)

like image 36
amitesh kumar Avatar answered Oct 17 '22 22:10

amitesh kumar