When is the ctl00 prefix added?
asp.net, html
Solution
I had the same problem when I migrated from `.Net 3.5` to `.Net 4.0`.
I solved it by adding the following configuration in `web.config` in IIS6. For IIS7, use the `system.webServer` section:
<system.web>
<pages controlRenderingCompatibilityVersion="3.5" clientIDMode="AutoID"/>
</system.web>
Problem
I have a simple asp.net page with an asp.net link button and asp.net content tag which point to a simple asp.net master page with an asp.net content place holder and a form tag. Here is the code of these two items: Site.Master: ``` <%@ Master Language="C#" AutoEventWireup="true" CodeBehind="Site.master.cs" Inherits="WebApplication1.SiteMaster" %> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title></title> </head> <body> <form runat="server"> <asp:ContentPlaceHolder ID="MainContent" runat="server"/> </form> </body> </html> ``` Default.aspx: ``` <%@ Page Title="Home Page" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="WebApplication1._Default" %> <asp:Content ID="BodyContent" runat="server" ContentPlaceHolderID="MainContent"> <asp:LinkButton ID="LinkButton1" runat="server">LinkButton</asp:LinkButton> </asp:Content> ``` For some reason when we run this simple web application on one server the id the link bhutton get is MainContent_LinkButton1 and when we run this application on another server the id the link button get is _ctl0_MainContent_LinkButton1 Doese someone have an idia why we get the prefix ctl0 in a specific server and in another server we don't get it?