Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Visual Studio find usages of a CSS class

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.

like image 670
dev.e.loper Avatar asked Aug 28 '10 22:08

dev.e.loper


People also ask

How do I search for a class in CSS?

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.

How do I search a .CSS file in Visual Studio?

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).

What is CSS class property?

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.

What is the CSS class in asp net?

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.


1 Answers

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>
like image 100
R. Martinho Fernandes Avatar answered Sep 30 '22 08:09

R. Martinho Fernandes