why only one server-form in an aspx file?

  • Thread starter Thread starter Dan
  • Start date Start date
D

Dan

Hi again,

I tried to create a second server-form in an aspx file, but there can be
only one.
Independantley of it's useful or not, why is it so?

And why can't i create a form directly in vb.net (from the code-behind page)
assuming i first deleted the form tag in the aspx file?

Thanks
Dan
 
I conjecture that you cannot have 2 server side form controls because
the ASP.NET uses the form arguments to bind data to controls and there
is no direct way to identify what form you are posting (in that case
for example you would have to have 2 viewstates).

What are you trying to achieve?

Regards,
Tasos
 
Thanks, i wanted only to know the reason, that's all.
With classic asp, it was possible to have more than one form for posting,
having each an ID, so why not with asp.net ...
 
Actually, you *can* have more than one web form in an aspx page,
but you don't have that capability out-of-the-box. You need to program it.

This article by Paul Wilson may explain this for you :

http://aspalliance.com/articleViewer.aspx?aId=132&pId=

If you want to have more than one web form in ASP.NET, you can purchase
Paul's component, the WilsonWebForm, or develop a similiar component yourself.




Juan T. Llibre, asp.net MVP
aspnetfaq.com : http://www.aspnetfaq.com/
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en español : http://asp.net.do/foros/
===================================
 
Thanks

Juan T. Llibre said:
Actually, you *can* have more than one web form in an aspx page,
but you don't have that capability out-of-the-box. You need to program it.

This article by Paul Wilson may explain this for you :

http://aspalliance.com/articleViewer.aspx?aId=132&pId=

If you want to have more than one web form in ASP.NET, you can purchase
Paul's component, the WilsonWebForm, or develop a similiar component yourself.




Juan T. Llibre, asp.net MVP
aspnetfaq.com : http://www.aspnetfaq.com/
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en español : http://asp.net.do/foros/
===================================
 
re:
You can have multiple server forms in an ASPX, but only one can be visible at a time.

Kirk, that sort of defeats the purpose, doesn't it ?

As a comment at that site sytates, you can also do it with a Panel.

For *multiple forms visible at all times*, see the article I referenced in my last post:

http://aspalliance.com/articleViewer.aspx?aId=132




Juan T. Llibre, asp.net MVP
aspnetfaq.com : http://www.aspnetfaq.com/
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en español : http://asp.net.do/foros/
===================================
 

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

Back
Top