Picture it: you've just written an aspx page with 3 panels, 3 datagrids, 15 buttons, 20 textboxes, and 3 drop down lists. You've also added about 30 subs to your code behind.
THATS ALOT OF CODE!
Traditionally, viewing the code would mean one big, long page that seems to go on forever and ever in a big listing of code. You could group the code and add nice little comment lines like
'---------------------------------------------------
but that was the only real way to seperate them.
Visual Studio.NET provides a new way to organize your code that makes grouping related subs/functions a snap, and makes it look pretty. This new way is called a Region.
To make a Region, all you need to do is type
#Region "descriptive text"
#End Region
This will create a top level container that you can dump code into. To hide all the code, you just have to click on the regions +/- button and voila!
To give you an example of what I've done with one of my apps, here's a schema of my code:
-ControlList
-PageCode
-TabButtonCode
-StateCode
-MenuButtonCode
-Panel:Main
-ListBoxCode
-FillList
-ClearList
-Paneletails
-DatagridCode
-Panel:Results
-DatagridCode
-Panel:Find
-DatagridCode
As you can see, a huge page of code is now viewed as an xml-like tree, so that only the information you want is hte information you have to dig through.
As Martha would say, "Regions: they're a good thing"
Jack
THATS ALOT OF CODE!
Traditionally, viewing the code would mean one big, long page that seems to go on forever and ever in a big listing of code. You could group the code and add nice little comment lines like
'---------------------------------------------------
but that was the only real way to seperate them.
Visual Studio.NET provides a new way to organize your code that makes grouping related subs/functions a snap, and makes it look pretty. This new way is called a Region.
To make a Region, all you need to do is type
#Region "descriptive text"
#End Region
This will create a top level container that you can dump code into. To hide all the code, you just have to click on the regions +/- button and voila!
To give you an example of what I've done with one of my apps, here's a schema of my code:
-ControlList
-PageCode
-TabButtonCode
-StateCode
-MenuButtonCode
-Panel:Main
-ListBoxCode
-FillList
-ClearList
-Paneletails
-DatagridCode
-Panel:Results
-DatagridCode
-Panel:Find
-DatagridCode
As you can see, a huge page of code is now viewed as an xml-like tree, so that only the information you want is hte information you have to dig through.
As Martha would say, "Regions: they're a good thing"
Jack