如何阻止Visual Studio重命名我的控件?

时间:2021-07-12 07:10:13

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.

在已经具有ID DropDownListExpirationDate的控件的ASPX文件上,它将新粘贴的控件重命名为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?

有没有办法禁用此功能?

1 个解决方案

#1


57  

After a quick check(!)....

快速检查后(!)....

Tools > Options > Text Editor > HTML > Miscellaneous

工具>选项>文本编辑器> HTML>杂项

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

取消选中“在源视图中粘贴时自动ID元素”。

#1


57  

After a quick check(!)....

快速检查后(!)....

Tools > Options > Text Editor > HTML > Miscellaneous

工具>选项>文本编辑器> HTML>杂项

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

取消选中“在源视图中粘贴时自动ID元素”。