A page can have only one server-side Form tag

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
 
S

Steve C. Orr [MVP, MCSD]

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
 
T

Tom

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?
 
S

Steve C. Orr [MVP, MCSD]

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.
 

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

Members online

No members online now.

Forum statistics

Threads
473,982
Messages
2,570,185
Members
46,738
Latest member
JinaMacvit

Latest Threads

Top