I have a gridview taking data from object data source. The object data source is taking data from a method which takes one parameter (string). The parameter is supplied from page url using querystring, and the default value is set to null. In the method taking parameter, I am trying to check if the parameter is null return all data else return data with id got from the parameter - eg. code.
public list<string> MyMethod (string param)
{
if(param == null)
{
return // all
}
else
{
return // id with param
}
}
I tried to debug the program and the param is actually null but the if () statement is always going to "false" condition. i.e. param == null always evaluating to false. I tried String.IsNullorEmpty(param), and it still is evaluating to false. I don't understand what the problem is. Please help. Many Thanks.