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 GridView1
will become ContentPlaceholder1_ContentPlaceHolder2_GridView1
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" %>