A page can have only one server-side Form tag

Discussion in 'ASP .Net' started by Tom, Nov 27, 2003.

  1. Tom

    Tom Guest

    Hi,

    I have a web page which has server side include for top,
    left, main and bottom.aspx pages.

    In the left.aspx, there is a login web control which has a
    pair of form tags.

    In the main page, there is a registration form which has a
    pair of form tags.

    So, there are 2 pairs of form tags in one index.aspx page.

    I cannot run it and it prompted the error of "A page can
    have only one server-side Form tag".

    I removed the </form> for left.aspx and <form> for
    main.aspx. It cannot run also as it said the respective
    form tag was missed.

    So, how can I handle a web form which has 2 forms?

    Thanks

    Tom
     
    Tom, Nov 27, 2003
    #1
    1. Advertising

  2. The most common replacement for old fashioned include files are web user
    controls.
    They basically are like object oriented include files on steroids.
    They'll solve your form problem along with a bunch of other problems you
    never knew you had.

    Here's more info:
    http://msdn.microsoft.com/library/d...n/html/vbconintroductiontowebusercontrols.asp
    http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vbcon/html/vboriwebusercontrols.asp
    http://msdn.microsoft.com/library/d...l/vbconWebUserControlsVsCustomWebControls.asp

    --
    I hope this helps,
    Steve C. Orr, MCSD, MVP
    http://Steve.Orr.net
    Hire top-notch developers at http://www.able-consulting.com



    "Tom" <> wrote in message
    news:7d8d01c3b4a1$412f7770$...
    > Hi,
    >
    > I have a web page which has server side include for top,
    > left, main and bottom.aspx pages.
    >
    > In the left.aspx, there is a login web control which has a
    > pair of form tags.
    >
    > In the main page, there is a registration form which has a
    > pair of form tags.
    >
    > So, there are 2 pairs of form tags in one index.aspx page.
    >
    > I cannot run it and it prompted the error of "A page can
    > have only one server-side Form tag".
    >
    > I removed the </form> for left.aspx and <form> for
    > main.aspx. It cannot run also as it said the respective
    > form tag was missed.
    >
    > So, how can I handle a web form which has 2 forms?
    >
    > Thanks
    >
    > Tom
    >
    >
     
    Steve C. Orr [MVP, MCSD], Nov 27, 2003
    #2
    1. Advertising

  3. Tom

    Tom Guest

    I read the web user control online tutorial. it said there
    are no html, form tags in ascx files.

    so, i removed all the form tags insides the left and main
    ascx files. but, the error said textbox must need form
    tags.

    how can i fix this problem?
     
    Tom, Dec 2, 2003
    #3
  4. You must have exactly one server form tag (and of course the matching
    closing tag.)
    Your user controls should exist within this form. In other words your
    control's declaration tag should be between the opening and closing form
    tags.

    --
    I hope this helps,
    Steve C. Orr, MCSD, MVP
    http://Steve.Orr.net
    Hire top-notch developers at http://www.able-consulting.com



    "Tom" <> wrote in message
    news:0c9501c3b8f0$038add80$...
    > I read the web user control online tutorial. it said there
    > are no html, form tags in ascx files.
    >
    > so, i removed all the form tags insides the left and main
    > ascx files. but, the error said textbox must need form
    > tags.
    >
    > how can i fix this problem?
    >
    >
     
    Steve C. Orr [MVP, MCSD], Dec 2, 2003
    #4
    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. Tom
    Replies:
    8
    Views:
    946
    Eric Veltman
    Dec 11, 2003
  2. =?Utf-8?B?UmF5IENhY2NpYXRvcmU=?=

    A page can have only one server-side Form tag.

    =?Utf-8?B?UmF5IENhY2NpYXRvcmU=?=, Jul 16, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    4,432
  3. VB Programmer
    Replies:
    2
    Views:
    1,083
    VB Programmer
    Nov 4, 2004
  4. ScottF
    Replies:
    1
    Views:
    7,380
    Ken Cox [Microsoft MVP]
    Dec 2, 2004
  5. AlecL
    Replies:
    2
    Views:
    537
    AlecL
    Jan 2, 2007
Loading...

Share This Page