I'm using a little helper method:
public static int QueryString(string paramName, int defaultValue)
{
int value;
if (!int.TryParse(Request.QueryString[paramName], out value))
return defaultValue;
return value;
}
This method allows me to read values from the query string in the following way:
int id = QueryString("id", 0);