Sibusiso Shongwe
Sibusiso Shongwe

Reputation: 175

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 GridView1 will become ContentPlaceholder1_ContentPlaceHolder2_GridView1 at runtime.

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

Upvotes: 0

Views: 66

Answers (1)

Tim Schmelter
Tim Schmelter

Reputation: 460328

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" %>

Upvotes: 1

Related Questions