Page Hierarchy confusion...

J

J'son

Ok, thanx in advance for all who can help me. I've coded in ASP for
years, but am new to ASP.NET. I have a small ecommerce store im
migrating over to ASP.NET (C#) and I am confused about this tag:

<form runat="server">

I know that when a form has "runat=server", any ACTION (at design
time) I specify will be overridden and that the page will ALWAYS
postback to itself. However, my store has 4 pages - Products, Customer
Info, Check Out, and Thank you/Sorry. In ASP, it went like this:

Products Page: User selects products, hits submit. Form action takes
user to Customer Info, all Request.Form info is present. Request.Form
Product info is persisted by using hidden fields.

Customer Info Page: User supplies shipping info, cc #, et, hits
submit. Form action takes user to Check Out, all Request.Form info is
present. All previous Request.Form info is persisted by using hidden
fields.

Check Out Page: User views summary, likes what he sees and clicks
"Confirm". Page posts to Thank you/Sorry where actual store processing
takes place and user is shown a receipt and a thank you or a "Sorry..
heres the problem" message.

Since ASP.NET supplies the default form with runat=server tag, I was
wondering if there is now a better (more efficent) way of doing
things. Should I:

1. Remove the runat=server tag and proceed as before?
2. Keep the runat=server tag, use IsPostBack on each page, somehow
persist the Request.Form values into something else (no Sessions
plz!), and then Redirect/Transfer to the next page?
3. Or am I missing something else here.. ViewState manipulation from
one page to the next?

Just looking for ideas...

Thanx!

J'son
 
D

David Jessee

Man, you're comparing Apples and Oranges here.
Granted, you're still dealing with rendered HTML, requests, responses,
sessions, etc. However, ASP.NET encapsulates all of that inside of a
totally difference platform.

I've worked with a number of developers making the transition from ASP to
ASP.NET, both as a Trainer and a Manager. The best thing you can do is to
take a step back and start from the ground up. If you're working with
VB.NET as your supporting language, you have to take another step back
because there is very little in common with these two languages except for
the basic syntax and the name (VB).

Take a look at this article:
http://www.4guysfromrolla.com/webtech/041601-1.shtml

There are also a lot of ASP to ASP.NET books out there that are invaluable
resources for you.

Side Note, sessions arent't all that bad anymore, you can have them managed
by a database, so all of your session information does not reside in the
server's memory.
 
J

J'son

Thanx David.. I think I can do what I need to using Context.Handler
and some public variables. That way the page can validate itself and
then Server.Transfer to the next page.

Thanx again..

J'son
 

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

Top