I\'m curious what everyone does for handling/abstracting the QueryString in ASP.NET. In some of our web apps I see a lot of this all over the site:
int val = 0;
I'm with the poster who suggested the helper methods (I would comment on his, but can't yet). Someone else disagreed with him in favor of creating properties, but my answer to that is that it doesn't gracefully handle the issue of checking for nulls or invalid formatting, etc. If you have helper methods, all that logic can be written once and centralized.
If you have a lot of pages, adding properties for each might be more time consuming than it is worth. But that's obviously just a preference, so to each his/her own.
One cool thing you could improve on the other poster's helper method is to make the out parameter a reference parameter instead (change out to ref). That way you can set a default value for the property, in case it is not passed. Sometimes you might want optional parameters, for instance -- then you can have it start with some default value for those cases where the optional parameter is not explicitly passed (easier than having a default value passed separately in). You can even add an IsRequired boolean parameter at the end, and have it throw an exception if the bool is set to true and the parameter is not passed. That can be helpful in many cases.