开发者

vs2010 - shortcut for surrounding a String by double quotes

开发者 https://www.devze.com 2023-03-27 09:29 出处:网络
I used to work with a developer who, selects a text in aspx page and applies a keyboard shortcut to enclose it in double quotes.

I used to work with a developer who, selects a text in aspx page and applies a keyboard shortcut to enclose it in double quotes.

Eg: runat=server. when i select server and press ctrl+somekey, it should be runat="server"

Could someone tell me what is the keyboard shortcut, i tried googling a lot, but开发者_运维问答 couldnt find one..

Currently we are overhauling a page, and need this badly...

Thanks in advance.


As far as I know this is a setting in Visual Studio which enables you to immediatelly place quotes when you type attribute and press equals sign or if you type a few letter and press CTRL+Space. This will autocomplete the attribute and place quotes. In order to enable the quotes click on Tools then Options. If it is not checked, check Show all settings. Expand Text Editor, then HTML and click on Formatting. On the right side enable Insert attribute values quote when typing and Insert attribute value quotes when formatting


Format selection: ctrl+k, ctrl+f

I also have Tools > Options > HTML > Formatting > Insert attribute value quotes when formatting checked.


I think you should try this with the replace function

search : runat=server

replace: runat="server"


The developer may have been using a refactoring tool such as CodeRush or Resharper. Have a look at this link for how you may be able to do something similar without extra tools.

0

精彩评论

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

关注公众号