RSS 2.0 Feed
RSS 2.0

Atom 1.0 Feed
Atom 1.0

  ASP.NET QueryString Parameter Binding 


I came across an interesting article on CodeProject today from a guy named Piers Williams. The article discusses an attribute based strategy for automatic population of instance fields and properties on an ASP.NET page from parameters supplied via properties of the Request object (.QueryString, .Form etc...). A very interesting approach. I am not endorsing using it and haven't really considered the performance impact that this might have - but what I found interesting was the approach. I really like to see people think outside the box. To look at a tedious or repetative task and find a better solution for it.

This approach allows you to populate instance fields & properties using attrubutes which specify the QueryString or Form parameter to bind to.

protected string FirstName; 

protected string LastName; 

protected int CustomerID; 

Even add defaults:

[QueryParameter("CustID", DefaultValue="0")]
public int CustomerID;

Very cool. Pretty smooth and a great idea. You can see the entire article here: Declarative QueryString Parameter Binding.


Leave a comment below.


  1. Fabrice 5/17/2005 4:21 PM
    There is a new product along the same lines that helps to work with URLs: PageMethods.
    PageMethods enables well-defined URLs using methods and attributes.
    Learn more at
  2. 9/19/2009 3:30 AM
    olusqxlu - Google Search
  3. 11/22/2009 6:26 AM
    nugvjrix - Google Search
Comments have been closed on this topic.



Also see my CRM Developer blog