Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do you customize the copy/paste behavior in Visual Studio 2008?

How do you customize the Copy/Paste behavior in Visual Studio 2008?

For example I create a new <div id="MyDiv"></div> and then copy and paste it in the same file.

VisualStudio pastes <div id="Div1"></div> instead of the original text I copied.

It is even more frustrating when I'm trying to copy a group of related div's that I would like to copy/paste several times and only change one part of the id.

Is there a setting I can tweak to change the copy/paste behavior?

like image 327
Brian Boatright Avatar asked Sep 15 '08 21:09

Brian Boatright


2 Answers

Go into Tools > Options > Text Editor > HTML > Miscellaneous and uncheck "Auto ID elements on paste in Source view"

like image 54
DamienG Avatar answered Sep 30 '22 19:09

DamienG


In Visual Studio 2019 the new location is
Tools > Text Editor > ASP.NET Web Forms
and Check Format HTML on paste.
So now it is possible to efficiently duplicate sequential ID codes.

like image 43
Geospatial Avatar answered Sep 30 '22 19:09

Geospatial