Wonderful, thanks a lot Grant.
Imran
"Grant Merwitz" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
>I do it like this
>
> if(Request.QueryString["key1"] != "" && Request.QueryString["key1"] !=
> null)
> {
> //Querystring exists
> }
>
> And to make this less painful, i also create a static method that i call
> for this.
>
> So:
>
> public class Common
> {
> public static bool HasValue(object o)
> {
> if (o == null)
> {
> return false;
> }
>
> if (o == System.DBNull.Value)
> {
> return false;
> }
>
> if (o is String)
> {
> if (((String) o).Trim() == String.Empty)
> {
> return false;
> }
> }
>
> return true;
> }
> }
>
>
>
>
> "Imran Aziz" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
>> Hello All,
>> I have ASP.net , C# pages checking for query string variables, the old
>> ASP has a count property that one could check for each key/value pair to
>> determine if it is available in the query string or not, but ASP.net does
>> not have that for each key/value, instead there is a count for all items
>> in the query string.
>>
>> Say if I have a query string variable called key1=value1 how do I check
>> if key1 was set or not?
>> Thanks a lot in advance.
>>
>> Imran.
>>
>
>
|