postback


What is a postback?


I'm making my way into web development and have seen the word postback thrown around. Coming from a non-web based background, what does a new web developer have to know about postbacks? (i.e. what are they and when do they arise?)
Any more information you'd like to share to help a newbie in the web world be aware of postbacks would be most greatly appreciated.
The following is aimed at beginners to ASP.Net...
When does it happen?
A postback originates from the client browser. Usually one of the controls on the page will be manipulated by the user (a button clicked or dropdown changed, etc), and this control will initiate a postback. The state of this control, plus all other controls on the page,(known as the View State) is Posted Back to the web server.
What happens?
Most commonly the postback causes the web server to create an instance of the code behind class of the page that initiated the postback. This page object is then executed within the normal page lifecycle with a slight difference (see below). If you do not redirect the user specifically to another page somewhere during the page lifecycle, the final result of the postback will be the same page displayed to the user again, and then another postback could happen, and so on.
Why does it happen?
The web application is running on the web server. In order to process the user’s response, cause the application state to change, or move to a different page, you need to get some code to execute on the web server. The only way to achieve this is to collect up all the information that the user is currently working on and send it all back to the server.
Some things for a beginner to note are...
The state of the controls on the posting back page are available within the context. This will allow you to manipulate the page controls or redirect to another page based on the information there.
Controls on a web form have events, and therefore event handlers, just like any other controls. The initialisation part of the page lifecycle will execute before the event handler of the control that caused the post back. Therefore the code in the page’s Init and Load event handler will execute before the code in the event handler for the button that the user clicked.
The value of the “Page.IsPostBack” property will be set to “true” when the page is executing after a postback, and “false” otherwise.
Technologies like Ajax and MVC have changed the way postbacks work.
From wikipedia:
A Postback is an action taken by an
interactive webpage, when the entire
page and its contents are sent to the
server for processing some information
and then, the server posts the same
page back to the browser.
Expanding on the definitions given, the most important thing you need to know as a web-developer is that NO STATE IS SAVED between postbacks. There are ways to retain state, such as the Session or Viewstate collections in ASP.NET, but as a rule of thumb write your programs where you can recreate your state on every postback.
This is probably the biggest difference between desktop and web-based application programming, and took me months to learn to the point where I was instinctively writing this way.
Postback happens when a webpage posts its data back to the same script/dll/whatever that generated the page in the first place.
Example in C# (asp.net)
...
if (!IsPostback)
// generate form
else
process submitted data;
The term is also used in web application development when interacting with 3rd party web-service APIs
Many APIs require both an interactive and non-interactive integration. Typically the interactive part is done using redirects (site 1 redirects a user to site 2, where they sign in, and are redirected back). The non-interactive part is done using a 'postback', or an HTTP POST from site 2's servers to site 1's servers.
When a script generates an html form and that form's action http POSTs back to the same form.
Web developement generally involves html pages that hold forms (<form> tags). Forms post to URLs. You can set a given form to post to any url you want to. A postback is when a form posts back to it's own page/url.
The term has special significance for ASP.Net developers, because it is the primary mechanism that drives a lot of the behavior for a page -- specifically 'event handling'. ASP.Net pages have exactly one server form that nearly always posts back to itself, and these post backs trigger execution on the server of something called the Page Lifecycle.
A post back is anything that cause the page from the client's web browser to be pushed back to the server.
There's alot of info out there, search google for postbacks.
Most of the time, any ASP control will cause a post back (button/link click) but some don't unless you tell them to (checkbox/combobox)
Postback is essentially when a form is submitted to the same page or script (.php .asp etc) as you are currently on to proccesses the data rather than sending you to a new page.
An example could be a page on a forum (viewpage.php), where you submit a comment and it is submitted to the same page (viewpage.php) and you would then see it with the new content added.
See: http://en.wikipedia.org/wiki/Postback
Postback refers to HTML forms. An HTML form has 2 methods: GET and POST. These methods determine how data is sent from the client via the form, to the server. A Postback is the action of POSTing back to the submitting page. In essence, it forms a complete circuit from the client, to the server, and back again.
Yet the question is answered accurately above, but just want to share my knowledge .
Postback is basically a property that we can use while doing some tasks that need us to manage the state of the page, that is either we have fired some event for e.g. a button click or if we have refreshed our page.
When our page loads for the very first time , that is if we have refreshed our page, at that time postback-property is false, and after that it becomes true.
if(!ispostback)
{
// do some task here
}
else
{
//do another task here
}
http://happycodng.blogspot.in/2013/09/concept-of-postback-in.html
PostBack is the name given to the process of submitting all the information that the user is currently working on and send it all back to the server. Postback is actually sending all the information from client to web server, then web server process all those contents and returns back to client. More about.....Asp.Net Postback
Rj
From Wikipedia:
In the context of web development, a postback is an HTTP POST to the same page that the form is on. In other words, the contents of the form are POSTed back to the same URL as the form.
Postbacks are commonly seen in edit forms, where the user introduces information in a form and hits "save" or "submit", causing a postback. The server then refreshes the same page using the information it has just received.
Postbacks are most commonly discussed in relation to JSF and ASP or ASP.NET.

Related Links

How to stop postback in ajaxbeginform in asp.net mvc
Selenium2 WebDriver (Page factory) error after a postback (Element not found in the cache)
converting time in query using to_char
How do I find my C# panel controls?
Get TextBox values entered before postback
CalendarExtender loose his value on postback
passing values using viewstate across postback in multiview
How do I do an http request upon successful Inno Setup install, for tracking purposes?
calculate sum of two numbers in asp.net without postback
Textbox inside a Repeater inside a Custom Server Control loses values
client-side values of dynamic control on postback
postback (a la ASP.NET) in other frameworks?
Cant assign values to variable in a user control on ajax postback… or something like that!
How to stop Telerik RadWindow from always reloading on the next PostBack
sending to paypal the “custom” variable on saved buttons ipn question
viewstate in reporting services

Categories

HOME
android
cygwin
twitter-bootstrap-3
turing-machines
flex
toolbox
pascal
fftw
sh
nuget
r-googlesheets
google-cloud-functions
azure-container-service
banner
joomla3.0
computer-science
sendgrid-api-v3
ipmitool
angular-dart
radgridview
renjin
plink
eip
selectize.js
modbus-tcp
powershell-v5.0
dimensional-modeling
git-extensions
foreign-keys
identity-management
symfony-console
mapstruct
replication
lilypond
ag
dpdk
react-toolbox
event-store
short-url
jquery-multiselect
exchangewebservices
quantlib
jaws
failover
dotspatial
panoramas
dst
mockjax
hibernate-validator
r-grid
papaparse
linkedhashmap
dsx-desktop
twos-complement
joomla2.5
protege4
raft
lint
filesystemwatcher
recurrent-neural-network
loading
urlsession
tasm
visa
attributeerror
naming
movilizer
microsoft-metro
vaadin-elements
servermanager
double-click
jboss-4.2.x
openresty
reportservice2010
mschart
headless
gameplay-kit
renaming
sandcastle
rmongo
slackware
ziparchive
microstation
resourcemanager
windows-azure-queues
mta
wso2developerstudio
android-wake-lock
qiime
query-by-example
phpwebsocket
exim4
zscript
mirror
j-security-check
openbabel
metatrader5
buffering
paste
clickbank
ecslidingviewcontroller
c++builder-xe5
ebay-lms
printdialog
scringo
android-icons
bjyauthorize
android-sdk-2.3
extconf.rb
mysql-error-1205
rmdir
timthumb
msr
socketserver
resharper-6.0
delimited-text
updatesourcetrigger
interprocess
scrubyt
appliance

Resources

Mobile Apps Dev
Database Users
javascript
java
csharp
php
android
MS Developer
developer works
python
ios
c
html
jquery
RDBMS discuss
Cloud Virtualization
Database Dev&Adm
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App