Form forms in ASP. NET cannot be nested. asp. netform

Source: Internet
Author: User

Form forms in ASP. NET cannot be nested. asp. netform

I am very sure that there can be multiple form forms in ASP. I used to do this. In the background Classification Management page, add and modify the form on the same page, in this way, two form forms are used to submit the server code for processing.

After testing, ASP. NET can also have multiple form forms on a single page, for example, the following code:

<Form id = "form1"> </form> <form id = "form2"> </form> <form id = "form3"> </form>

However, form forms cannot be nested. For example, the following code is incorrect:

<Form id = "form1"> <form id = "form2"> </form>

In ASP. NET, when there are multiple form forms on the page, only one form can have the runat = "server" attribute; otherwise, an exception occurs. This is a common mistake in ASP. NET programming!

In ASP. NET programming mode, two or more form forms appear on a page. The function of submitting code to the server can all be done through an outermost form. There is no need to do so much. This is also a difference between ASP. NET and ASP!

I hope you can remember this!

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.