Is there a way in Visual Studio to find usages of a CSS class? Right now I have to do search the entire project to find all usages. Sometimes its hard if the class is named as something generic like "title". I will get all of these search results that have nothing to do with usage of that class.
class selector selects elements with a specific class attribute. To select elements with a specific class, write a period (.) character, followed by the name of the class. You can also specify that only specific HTML elements should be affected by a class.
Normally, you can right-click on a method and select "Go To Definition" (F12) or "Find All References" (SHIFT+F12). You can even go to the definition of a css class from your aspx page by pressing F12 (if your cursor is over the CssClass name).
Use the CssClass property to specify the CSS class to render on the client for the Web Server control. This property will render on browsers for all controls. It will always be rendered as the class attribute, regardless of the browser.
CssClass and Class properties are used to apply any CSS class to the controls or elements. But the only difference is class property is used for HTML controls while CssClass property is used for Server controls. It is not necessary to use CssClass property for Server controls, you can use class property aswell.
I don't know of any built-in way of doing this in Visual Studio, but some regex magic might do the trick. Try searching for this:
class="[^"]*<title>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With