I use asp.net with code behind and c#.
So I have two file for every .aspx page in VS 2010.
In .aspx.cs page I am able to add regions in my code using:
#region Name Region
#endregion
My questions:
Thanks for your help.
cshtml code editor, type region , then press Tab key. This implements #region snippet code like below: <! -- #region name --> //Your html or cshtml codes <!
Select the Visual C# -> Web templates group on the left. Then, select Web Form from the middle list and name it FirstWebPage. aspx. Click Add to add the web page to your project.
Select some piece of code and use (ctrl+r, ctrl+e), type your region name and press enter. Or select some piece of code, press F1 and type "Move into #region".
Do you know the keyboard shortcuts to expand or collapse all my region in my code?
Here are some key chords for you.
Ctrl-M Ctrl-O will collapse all the regions in the opened document (or the highlighted section).
Ctrl-M Ctrl-M will collapse or open the collapsible section the cursor is on.
Ctrl-M Ctrl-L will collapse or open everything.
Now here is one i use frequently, especially in javascript files: highlight some code, then press Ctrl-M Ctrl-H to hide it, which will produce a little expander +-
next to the collapsed code. Press Ctrl-M Ctrl-O to expand it again.
Also see this blog post by Scott Guthrie which details some posters you can download with lots of the VS shortcut key combinations on them.
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