0

In Visual Studio 2017, if I copy

<asp:PlaceHolder ID="userControl1" runat="server">

and then try to paste it, it comes out as

<asp:PlaceHolder ID="Placeholder[n]" runat="server"></asp:PlaceHolder>

where [n] is some whole number; however, when I paste it into any other application, it comes out correct.

How should I approach solving this problem? Is it possible an extension is the culprit?

NetherGranite
  • 1,940
  • 1
  • 14
  • 42

1 Answers1

1

This is happening because a control with that ID already exists within that webform.

Visual Studio will try to make sure that duplicate ID's aren't inserted into your .aspx. When you remove the pre-existing control, it will 'paste correctly'.

You can turn this functionality off in the options menu:

Tools>Options>Text Editor>HTML>Miscellaneous>Auto ID On Paste/Format HTML/Close Brace

This might help you.