Form tag is not displayed Name element

I have rendering a form tag as

<form method="post" action="AdminEditListTest.aspx" id="Form1" name="Form1">


This is legacy code that uses


to manipulate the DOM

there are 100 pages that do this.

When we updated the app it stopped rendering the attribute name

<form method="post" action="AdminEditListTest.aspx" id="Form1" >


I understand that setting (in the web.config file)

 xhtmlConformance = "Legacy"


AND CUSTOMIZATION (on the page itself)

<!DOCTYPE html PUBLIC "-//W3C//ELEMENTS XHTML Legacy Markup 1.0//EN" 
 "" >


should force IIS to display name attributes, but that doesn't work. Are there any other tricks / tactics I can use to get the attribute to name

appear on the form element?


source to share

1 answer

So the solution (in addition to setting xhtmlConformance = "Legacy"

in web.config

should have also <pages controlRenderingCompatibilityVersion="3.5" />

in web.config

ASP.NET controls have been changed in the .NET Framework version 4 so that you can more accurately define how they display markup. In previous versions of the .NET Framework, some controls released markup that you couldn't turn off. By default ASP.NET 4 no longer generates this type of markup. If you are using Visual Studio 2010 to upgrade your application from ASP.NET 2.0 or ASP.NET 3.5, the tool automatically adds a setting to the Web.config file that retains the old rendering. However, if you update your application by changing the application pool in IIS to target the .NET Framework 4, ASP.NET uses the new default rendering mode. To disable the new rendering mode, add the following setting to your Web.config file:

<pages controlRenderingCompatibilityVersion="3.5" />




All Articles