View Full Version : Folding #region?

04-19-2011, 11:48 AM
Hi all,

I'm developing a website in Visual Web Developer 2010 Express, C#, and my files are becomming pretty large now. I figured I would just create some #regions and collapse them. I have a .cs file, and a .ashx file, and somehow there is a difference, because I am able to collapse regions and functions in the .cs file, but not in the .ashx file, the + and - signs on the left are not showing. It's probably some configuration option, but I can't seem to find it. Anybody have any ideas?

04-21-2011, 09:58 AM
After some searching I've found the solution. The problem is that the .ashx file and the .cs file are opened in a different editor. You can add a filetype to the options to have the .ashx file opened in the editor of the .cs file, but that would give errors on the first line of the .ashx.

My own solution is to have the code in a seperate .cs file. This is not possible with a .ashx file, but I've created a class in the AppCode folder, and extended my .ashx to that class :)

I've added a bit more extensive comment to where I found the solution, here (http://stackoverflow.com/questions/359528/visual-studio-asp-net-expand-and-collapse-issue-in-ashx-generic-handlers)