[thelist] ASP.NET multiple forms question

jason.handby jason.handby at corestar.co.uk
Fri Jul 14 09:23:54 CDT 2006


Hi Rob,


> I chose the one page approach simply because I had white 
> space to use and didn't want to overcomplicate the GUI with 
> multiple pages. The obvious way to think about this in .NET 
> when we ultimately go there is to redesign this through 
> separated areas, each with it's own page. Not really an issue 
> to fuss over.

I think it's fine to have several pieces of independent functionality on
one page. In Classic ASP you can separate out the server-side code for
those three independent things by having each one submit its data to a
different page -- hence the need for three form tags.

But in ASP.NET everything has to post back to the page you're on, and
you can only have one form tag anyway. However you can still put
everything on one page -- you just have to use a different approach to
separating out the server-side code. This is where user controls come in
handy.


> However, I see your point about multiple forms on one page. I 
> ran into this in our testing environment. In a Classic ASP 
> format, what do we do about this page in .NET:
> http://www.lexjet.com/lexjet/compatibility.asp ?
> 
> The solution I came up with on the .NET version is to have 
> our search fields run server side through a click event. 
> Since the nature of the Google Mini is method="GET" or most 
> search engines, I had a button click event to grab the 
> textBox1.text value and build the querystring, quickly 
> followed by a redirect page command. It solved the equation 
> and allowed, what looked like, two forms on one page. The 
> form was the entire page.
> The textbox and submit (type="button") button where 
> independent to the functionality to the real heart of the main form.

I suggest you make the search fields into a user control. Then you can
just drop it into any page that needs it.




Jason



More information about the thelist mailing list