469,925 Members | 1,548 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,925 developers. It's quick & easy.

multiple forms on single page?

this was impossible to implement on old ASP, is it the same for .Net?
Nov 18 '05 #1
6 1743
Actually was not impossible on classic ASP.

Jeff

"Davids" <db****@simnet.is> wrote in message
news:um**************@TK2MSFTNGP11.phx.gbl...
this was impossible to implement on old ASP, is it the same for .Net?

Nov 18 '05 #2
Hi,

In ASP multiple forms were no problem at all. In ASP.Net you can only have
one form (Form1) for server controls. These will then be available to you
with their values when you post back. You can also add all the other forms
you want but they won't be as useable server-side. I believe you can still
get your values but you need to go through the Request object rather than
having an object that represents each control to work with. I may be wrong
about that last point though so hopefully someone who knows for sure can
talk about this. Good luck! Ken.

--
Ken Dopierala Jr.
For great ASP.Net web hosting try:
http://www.webhost4life.com/default.asp?refid=Spinlight
If you sign up under me and need help, email me.

"Davids" <db****@simnet.is> wrote in message
news:um**************@TK2MSFTNGP11.phx.gbl...
this was impossible to implement on old ASP, is it the same for .Net?

Nov 18 '05 #3
You can only have 1 <form id="myForm" runat="server"> server control.
However, you can still use plain ole html forms with action="some url"; but
it cannot have a runat="server". Once you do this, you cannot have any
asp.net server controls within this HTML form tag.

There is a work-a-round comming is asp.net 2.0. Stay tuned!

"Ken Dopierala Jr." wrote:
Hi,

In ASP multiple forms were no problem at all. In ASP.Net you can only have
one form (Form1) for server controls. These will then be available to you
with their values when you post back. You can also add all the other forms
you want but they won't be as useable server-side. I believe you can still
get your values but you need to go through the Request object rather than
having an object that represents each control to work with. I may be wrong
about that last point though so hopefully someone who knows for sure can
talk about this. Good luck! Ken.

--
Ken Dopierala Jr.
For great ASP.Net web hosting try:
http://www.webhost4life.com/default.asp?refid=Spinlight
If you sign up under me and need help, email me.

"Davids" <db****@simnet.is> wrote in message
news:um**************@TK2MSFTNGP11.phx.gbl...
this was impossible to implement on old ASP, is it the same for .Net?


Nov 18 '05 #4
If you are simply referring to a matter of having the tags in the same
page, but not needing to use them all at the same time, you can put
them in panels. When the HTML is rendered, only 1 FORM tag should be
visible (all panels with form tags but one should be hidden).

Perhaps if you explain your intent we can provide a solution.
Thanks,
Ian Suttle
http://www.IanSuttle.com

Nov 18 '05 #5
"Davids" <db****@simnet.is> wrote in message
news:um**************@TK2MSFTNGP11.phx.gbl...
this was impossible to implement on old ASP, is it the same for .Net?


Er...no it wasn't...
Nov 18 '05 #6
You can only have one visible server form on the page at a time.
So you could have more than one server form as long as you only show one at
a time.
Or you can have more than one form visible on your page at a time, but only
one of them can be a server form (i.e. with the runat=server attribute.)
Server forms only support posting back to themselves (not to other pages.)

This will all become more flexible in .NET version 2.

--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://Steve.Orr.net
"Davids" <db****@simnet.is> wrote in message
news:um**************@TK2MSFTNGP11.phx.gbl...
this was impossible to implement on old ASP, is it the same for .Net?

Nov 18 '05 #7

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by Chris Beach | last post: by
2 posts views Thread by James X. Li | last post: by
3 posts views Thread by Pint | last post: by
11 posts views Thread by xenophon | last post: by
5 posts views Thread by Alex Maghen | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.