Rename Style (ASP.NET)
- 2 minutes to read
In This Article
Renames a style class. You can execute the refactoring in one of the following modes:
Mode | Description | Example |
---|---|---|
Qualified | Renames the style references that exactly matche the initial style reference. | For example, you declare the “mystyle” style classes for div and img elements. If you execute the refactoring for a style reference within a <div> tag, or within the class declaration, the refactoring will only rename all references to the div elements style class. |
Universal | Renames all style references that have the same name as the initial style reference. | For example, you declare the “mystyle” style classes for div and img elements. If you execute the refactoring for a style reference within a <div>, or an <img> tag, or within a class declaration, the refactoring will rename all references to “mystyle”. |
#Availability
Available from the context menu or via shortcuts:
- when the cursor is on a style class name within its declaration or reference, or when this name is selected.
#Examples
<head>
<title>MyPage</title>
<style>
img.mystyle{width:100px}
div.mystyle{width:200px; background-color:Green;}
</style>
</head>
<body>
<div class="mystyle"><p>My text</p></div>
<img id="image" class="mystyle" src="D:\MyImage.jpg" />
<img id="img1" class="mystyle" src="D:\TestImage.jpg" />
</body>
Result:
The Qualified mode
<head>
<title>MyPage</title>
<style>
img.newstyle{width:100px}
div.mystyle{width:200px; background-color:Green;}
</style>
</head>
<body>
<div class="mystyle"><p>My text</p></div>
<img id="image" class="newstyle" src="D:\MyImage.jpg" />
<img id="img1" class="newstyle" src="D:\TestImage.jpg" />
</body>
The Universal mode
<head>
<title>MyPage</title>
<style>
img.newstyle{width:100px}
div.newstyle{width:200px; background-color:Green;}
</style>
</head>
<body>
<div class="newstyle"><p>My text</p></div>
<img id="image" class="newstyle" src="D:\MyImage.jpg" />
<img id="img1" class="newstyle" src="D:\TestImage.jpg" />
</body>