ASP.NET Form - The form name\id changes to aspnetForm

natiz picture natiz · Dec 2, 2010 · Viewed 8.4k times · Source

I have this code:

<form Name="AddPlace" ID="AddPlace" action="AddPlace.aspx" class="niceform" method="post" runat="server">

That when i try to execute the code i get this instead:

<form name="aspnetForm" method="post" action="AddPlace.aspx" id="aspnetForm" class="niceform">

How come it changes?

Answer

parliament picture parliament · Jan 11, 2013

Set "clientidmode" attribute to "static" on the form tag to prevent the framework from override your name/id with "aspnetForm". This was driving me nuts for hours.