I am using master page and when I run this page, it shows the following error message:
a page can have only one server-side form tag
How can I solve this problem?
Solution 1 The reason for this error is that your having more than one FORM tag in your aspx page with run at server attribute, which ASP.Net does not allow. You can have only one form tag in your aspx page with run at server attribute. So keep only one form tag in user aspx page to avoid this error.
In ASP.NET MVC you can implement as many forms as you want (and it is valid & correct behavior of web pages). The reason all server controls are placed inside <form> tag is to allow the WebForms engine to recognize them, load their values & save their values from/to the ViewState.
I think you did like this:
<asp:Content ID="Content2" ContentPlaceHolderID="MasterContent" runat="server"> <form id="form1" runat="server"> </form> </asp:Content>
The form tag isn't needed. because you already have the same tag in the master page.
So you just remove that and it should be working.
It sounds like you have a form tag in a Master Page and in the Page that is throwing the error.
You can have only one.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With