Monday, March 26, 2012

why only one server-form in an aspx file?

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
DanI 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 ...
"Tasos Vogiatzoglou" <tvoglou@.gmail.com> wrote in message
news:1148768041.376044.82860@.38g2000cwa.googlegroups.com...
> 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
>
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 yoursel
f.
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 espaol : http://asp.net.do/foros/
===================================
"Dan" <sd> wrote in message news:eWL2QjkgGHA.5088@.TK2MSFTNGP02.phx.gbl...
> 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 ...
>
> "Tasos Vogiatzoglou" <tvoglou@.gmail.com> wrote in message
> news:1148768041.376044.82860@.38g2000cwa.googlegroups.com...
>
Thanks
"Juan T. Llibre" <nomailreplies@.nowhere.com> wrote in message
news:ObZY96kgGHA.1856@.TK2MSFTNGP03.phx.gbl...
> 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 espaol : http://asp.net.do/foros/
> ===================================
> "Dan" <sd> wrote in message news:eWL2QjkgGHA.5088@.TK2MSFTNGP02.phx.gbl...
posting,
>
You can have multiple server forms in an ASPX, but only one can be visible
at a time.
http://blogs.msdn.com/kaevans/archi.../19/482778.aspx
Kirk Allen Evans
Developer Evangelist
Microsoft Corporation
blogs.msdn.com/kaevans
=== This post provided "AS-IS" with no warranties and confers no rights ===
"Juan T. Llibre" <nomailreplies@.nowhere.com> wrote in message
news:ObZY96kgGHA.1856@.TK2MSFTNGP03.phx.gbl...
> 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 espaol : http://asp.net.do/foros/
> ===================================
> "Dan" <sd> wrote in message news:eWL2QjkgGHA.5088@.TK2MSFTNGP02.phx.gbl...
>
re:
> You can have multiple server forms in an ASPX, but only one can be visible at a ti
me.
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 m
y 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 espaol : http://asp.net.do/foros/
===================================
"Kirk Allen Evans" <kirke@.online.microsoft.com> wrote in message
news:ACE6415C-BE21-4381-927C-1F2C6228D539@.microsoft.com...
> You can have multiple server forms in an ASPX, but only one can be visible
at a time.
> http://blogs.msdn.com/kaevans/archi.../19/482778.aspx
> --
> Kirk Allen Evans
> Developer Evangelist
> Microsoft Corporation
> blogs.msdn.com/kaevans
> === This post provided "AS-IS" with no warranties and confers no rights ==
=
> "Juan T. Llibre" <nomailreplies@.nowhere.com> wrote in message
> news:ObZY96kgGHA.1856@.TK2MSFTNGP03.phx.gbl...
>

0 comments:

Post a Comment