multiple forms on single page?

Discussion in 'ASP .Net' started by Davids, Nov 10, 2004.

  1. Davids

    Davids Guest

    this was impossible to implement on old ASP, is it the same for .Net?
     
    Davids, Nov 10, 2004
    #1
    1. Advertising

  2. Davids

    Jeff Dillon Guest

    Actually was not impossible on classic ASP.

    Jeff

    "Davids" <> wrote in message
    news:...
    > this was impossible to implement on old ASP, is it the same for .Net?
    >
    >
     
    Jeff Dillon, Nov 10, 2004
    #2
    1. Advertising

  3. 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" <> wrote in message
    news:...
    > this was impossible to implement on old ASP, is it the same for .Net?
    >
    >
     
    Ken Dopierala Jr., Nov 10, 2004
    #3
  4. 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" <> wrote in message
    > news:...
    > > this was impossible to implement on old ASP, is it the same for .Net?
    > >
    > >

    >
    >
    >
     
    =?Utf-8?B?VGFtcGEgLk5FVCBLb2Rlcg==?=, Nov 10, 2004
    #4
  5. Davids

    Ian Suttle Guest

    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
     
    Ian Suttle, Nov 10, 2004
    #5
  6. Davids

    Mark Rae Guest

    "Davids" <> wrote in message
    news:...
    > this was impossible to implement on old ASP, is it the same for .Net?


    Er...no it wasn't...
     
    Mark Rae, Nov 10, 2004
    #6
  7. 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" <> wrote in message
    news:...
    > this was impossible to implement on old ASP, is it the same for .Net?
    >
     
    Steve C. Orr [MVP, MCSD], Nov 11, 2004
    #7
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Chris Beach
    Replies:
    0
    Views:
    587
    Chris Beach
    Sep 8, 2003
  2. Replies:
    4
    Views:
    967
  3. Ramachandran

    Handling multiple forms with single ASP page

    Ramachandran, Aug 21, 2004, in forum: ASP General
    Replies:
    3
    Views:
    186
    Evertjan.
    Aug 21, 2004
  4. Chris Beach
    Replies:
    1
    Views:
    238
    Jim Ley
    Sep 8, 2003
  5. ela
    Replies:
    12
    Views:
    365
    Uri Guttman
    Apr 6, 2009
Loading...

Share This Page