Customize Visual Studio for ID AutoGenerate

Customize Visual Studio for ID AutoGenerate

In this post we will learn about how to Customize Visual Studio for ID AutoGenerate.

What is ID autogenerate:

When we work in the Web form and create some asp.net web form control visual studio automatically generates it’s id that we can see when the page run in the browser. We can turn on/ turn off this behavior to take control of ID as per our requirements.

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

VisualStudio pastes <div id="Div1"></div>

It changes the value of id element automatically.

It is even more difficult when I’m trying to copy/paste several times and only change one part of the id.

Solution:

1) Open ‘Microsoft Visual studio’ from start menu.

2) Click on the Tools Menu in the menu bar.

2) Then, select the menu option named Options…
This will open the options dialog box.

3) Now, select the Text Editor -> HTML -> Miscellaneous  option item from left panel.

4) Then uncheck the checkbox saying “Auto ID elements on paste in Source view”

It’s Done.

Enjoy…!!