ASP.Net wants FORM everywhere!

D

Daves

in the old ASP I used FORMs only when relevant. In the .Net architecture
they seem to be unmissable because of the Postback functions eg
<a OnServerClick="_GoHere" runat="server">Click me</a>

Ok but isn't this quite a lot of waste of resources; to use a form for
simple navigation? I cannot see any other way though, using the old ASP
<a href="targetpage.asp?action=....">click me</a>

is very clumsy in .Net (reading the Request.Querystring("action") bla
bla...)?
 
E

Eliyahu Goldin

You can make an HTML-only page, with no server functionality. Then you don't
need to put <form> on the page.

Eliyahu
 
D

Daves

Eliyahu,
my question was not meant as an offence to .Net - it just boggles my mind
probably because of my 4 year old ASP3 background where the Form element was
only appropriate when asking for user input. To make my question more
specific I am actually just asking if this really is the case or am I
missing some important point
 
S

Scott Allen

Hi Daves:

It will take some time to adjust to the new paradigm. ASP.NET is
trying to abstract away the fact that we are programming web
applications. Instead we have controls to interact with and thier
events to respond to. Having a form on every page allows ASP.NET to
use some hidden input fields on every page to help the illusion along.
 
D

Daves

thx Scott so my understanding is correct, good to hear. I'll try to adapt!

What about then a situation, say- where there are two navigational areas,
eg. the classic left menu sidebar and a main page... Obivously the whole
page has to be inside a form element or else there'd have to be 2
forms....??
 
E

Eliyahu Goldin

It doesn't have to. If you prefer, you can make an html page with the left
menu made up out of links and an frame/iframe for the main page. Only the
main page will be a form. If you want the server to participate in menu
building, then the menu will have to be a form too.

Eliyahu
 

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,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top