26

If I paste something like

<asp:DropDownList ID="DropDownListExpirationDate" runat="server" />

onto an ASPX file that already has a control with ID DropDownListExpirationDate, it will rename the newly-pasted control as DropDownList1.

<asp:DropDownList ID="DropDownList1" runat="server" />

I'd rather it didn't. I'd rather it just paste exactly what I copied.

Is there a way to disable this feature?

Sam
  • 40,644
  • 36
  • 176
  • 219
Zack Peterson
  • 56,055
  • 78
  • 209
  • 280

1 Answers1

57

After a quick check(!)....

Tools > Options > Text Editor > HTML > Miscellaneous

Uncheck 'Auto ID elements on paste in Source view'.

Zack Peterson
  • 56,055
  • 78
  • 209
  • 280
CJM
  • 11,908
  • 20
  • 77
  • 115
  • 2
    [Apparently](http://stackoverflow.com/questions/19695992/disable-auto-id-elements-in-visual-studio-2013) this no longer works in VS2013. – Sam Dec 16 '14 at 03:24
  • I don't have v2013 so I can't comment, but I would assume there will be a comparable setting. Perhaps a 2013 owner can advise? – CJM Dec 16 '14 at 10:06
  • 3
    No longer there. Weird thing is, when I search via Quick Launch for 'auto id', I see an entry for 'Text Editor -> Html (Web Forms) -> Miscellaneous - Auto id elements on ...', but clicking it takes me to that tab in options but there is no such option to turn on and off. – Terry Jan 08 '15 at 09:14