开发者

Basic refactoring features (e.g., Rename) unavailable when editing code in an aspx/ascx files

开发者 https://www.devze.com 2022-12-23 07:45 出处:网络
I was just editing some C# code between <% %> tags in an .ascx file, and I noticed that the Refactor contextual menu is unavailable. And even if I manually add items from this menu to a custom t

I was just editing some C# code between <% %> tags in an .ascx file, and I noticed that the Refactor contextual menu is unavailable. And even if I manually add items from this menu to a custom toolbar, they are disabled when viewing aspx/ascx files.

I usually only have small snippets of C# code in my aspx/ascx files, but it would still be nice to be able to perform refactoring operations on any code that exists between <% %> tags. I feel like I'm going back to the dark ages when I have to use find/replac开发者_如何转开发e to change the name of a variable.

Questions

Is there a way to enable Visual Studio's refactoring features while viewing aspx/ascx files in Visual Studio?

Are there any Visual Studio plug-ins (preferably free) that offer this kind of functionality?


Resharper allows to change variable name in views. There is no Refactor menu under right click, but there is still refactoring in main menu and with shortcuts. It is not free, but definitely worth buying.

0

精彩评论

暂无评论...
验证码 换一张
取 消