PostBack Concept

M

Matthew Louden

I want to know if the PostBack concept applies to HTML web-based forms,
regardless of what programming technologies we use: For example, ASP,
ASP.NET, Java, CGI, etc...

PostBack means to send the HTML form to the web server? Since most of the
time I heard this term in ASP.NET circle, thats why I raise this question.

Please advise. Thanks!
 
T

TomB

In ASP.Net the whole idea is to treat a form like you would a windows form.
That is, the same page handles all of the events. Thus, in ASP.Net the
forms are set to POST to themselves and a built in property is available
called PostBack.

Before .Net I never even considered using a postback. All of my forms would
consist of Form1 where the user enters the information, then Page2 where the
information was processed and the user was given a response.

Since .Net I've realized the advantages of that approach and most of my
forms postback to the same page.

So is it a .Net only thing. Not at all. As long as the form's Action
property is set to the same page, it's what I'd call a postback. Most of my
forms look like this......

<%
if request.form("postback")="true" then
'note that true is in quotes because it's a string not a boolean
Call processTheForm
end if
%>

<form method=post action="thisSamePage.asp">
<input type=hidden name=postback value="true">
etc...
</form>
 
R

Rob Meade

...
PostBack means to send the HTML form to the web server? Since most of the
time I heard this term in ASP.NET circle, thats why I raise this question.

Definately in this instance I think more asp.net - there is a IsPostBack
feature enabling you to check whether or not this is the first time or not
that the form has been loaded.

Of course for normal ASP you'll find it mean more like "and now I want to
post this form back" - ie, if perhaps mandatory fields were filled in
incorrect and you were letting the server validate these or something...

This is my belief anywho...

Regards

Rob
 
D

David Morgan

Yes, I too have been doing this for years as if the user supplies an invalid
value you don't need to redirect as you can remember all the fields values.

<input type="text" name="Email"
value="<%=Server.HTMLEncode(Request.Form("Email"))%>">
 

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,770
Messages
2,569,583
Members
45,073
Latest member
DarinCeden

Latest Threads

Top