views:

58

answers:

2

In VB and C# there are #Region ... #endRegion and have it collapsable. Is there a similar way to do this in HTML?

Right now I just have comments blocking where the different elements are on my HTML page, but I would like to have a single collapse point instead of all of the <tr> <td> and <div> tags collapsed.

+7  A: 

I think the short answer is no.

Region is only a IDE directive recognised by the editor (Visual Studio). There is nothing in the HTML standard and anything you did put in the HTML would be sent straight down to the browser too, so I've not come across anything and can't imagine there would ever be anything.

Paul Hadfield
+1  A: 

Highlight the section you want collapsed, then go to Edit -> Outlining -> Hide Selection

Reference: How to: Collapse and Expand HTML Elements in Visual Web Developer

Edit: This assumes you're using Visual Studio

Ryan Kinal
As per @Jim's original statement in his question, this only allows existing HTML sections to be collapsed, you can't wrap several HTML elements in a #region and collapse that - closest you could do is a DIV element, but then that would be sent down to the client too.
Paul Hadfield
I don't believe it does. I just collapsed the middle of a paragraph using this method.
Ryan Kinal
Sorry, you're right. It's an extra bit of functionality I've not come across before. It nearly does the same as a region but you can't appear to give it a name and if you hide 3 lines, the "..." showing the hidden selection appears as the start of the 4th line (rather than a line of it's own) but it is hidden the section. And like you say, it is completely IDE driven and could work inside an HTML element or encompass part of 2 or more distinct elements.
Paul Hadfield
Yeah, it does lack the naming functionality. So, it's a partial solution.
Ryan Kinal