A page can have only one server-side Form tag

  • Thread starter Thread starter Tom
  • Start date Start date
T

Tom

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
 
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 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?
 
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.
 
Back
Top