Is it better programming to self-postback?

  • Thread starter Thread starter Ron H.
  • Start date Start date
R

Ron H.

I'm just wanting to know which is the more proper programming technique.

If I have a 3 page online form, is it better to post the page back to itself
or is it a better design to have 3 seperate webpages.

In other words:

One web page i.e. 'index.aspx' that submits back to itself and then displays
the appropriate form controls based on a variable ie. form1, form2, form3 to
let the page know which of the three forms that are coded on it to display.


Or


Moving from Page1.aspx, then to Page2.aspx, and the finally to Page3.aspx by
coding the postback url to the submit buttons postback url property.
 
I'm transitioning from programming classic ASP to ASP.Net and I'm not sure
which method is the more efficient form of programming.
 
I don't know if I would agree with that.

Efficiency can be defined in different ways by different people. Sometimes
efficiency is measured in ease of setup and maintenance and sometimes it's
measured in performance.

At the end of the day, in .NET, you have several options:

Traditional scenario where you have a page that collects data and posts it
to another page for further processing. This can be accomplished with the
CrossPage Postback feature of .NET 2.0 and up.

Original .NET paradigm of pages that postback to themselves (less pages to
maintain) and you then test on each page load for a postback. This *may*
require the use of ViewState, depending on what controls you've used in the
form.

In the end, from a performance standpoint, there really shouldn't be too
much of a difference in most forms. It really becomes a matter of
preference.

-Scott

Mark Rae said:
[please don't top-post]
http://www.caliburn.nl/topposting.html
I'm transitioning from programming classic ASP to ASP.Net and I'm not
sure which method is the more efficient form of programming.

The most efficient method is to use the <asp:Wizard /> control - it was
designed precisely for this purpose...
 
Back
Top