posted on 2005-05-19 at 22:48:08 by Joel Ross

MetaSapiens, via Fabrice Marguerie, has released their first product, and it's free! It's a cool component for managing URLs called PageMethods. It makes using URLs much easier, or at least it looks like it does.

We ran into these same issues, and our solution was to make constant classes that contained virtual paths to each page, and then a class for valid query strings by page as well as the valid values for query strings (if appropriate). For example, if your page has three display modes and you manage those ways through querystrings, we'd have four constants:

DisplayModeParam = "DisplayMode";
DisplayModeSimple = "Simple";
DisplayModeComplex = "Complex";
DisplayModeNormal = "Normal";

This way, we could build URLs and querystrings in code, and have them type checked. Of course, had PageMethods been available at the time, we probably would have used that instead.

Categories: ASP.NET