Wednesday, June 18, 2008

Disable auto id’s when copying ASP.NET controls

Don’t you hate it when you copy an ASP.NET server control without an ID, only to have it add one when you paste it?

For example, look at this code:
I took the first line, copied it and pasted it, and got the second line. It’s rare that I need to reference a validator in my CodeBehind.
Here is the option to disable this functionality in the Visual Studio options
(Tools->Options):


Simply uncheck the “Auto ID elements on paste in Source view” option.



2 comments:

BigBadBear said...

Top man

Anonymous said...

thank you...very helpful and time saving