Sibusiso Shongwe Sibusiso Shongwe - 10 months ago 31
ASP.NET (C#) Question

How do i prevent visual studio from renaming my id attributes?

I have recently migrated to visual studio 2015 community and my JavaScript no longer works because visual studio 2015 renames id attributes based on their content placeholders for example

will become
at runtime.

How do I turn this off, am using c# and asp.Net ?


You can set the ClientIDMode to Static, f.e. via page directive:

<%@ Control Language="C#"  ClientIDMode="Static" AutoEventWireup="true" CodeBehind="PageName.ascx.cs" Inherits="WepAppName.PageName" EnableViewState="false" %>