Here is my problem:
If my url has QueryString ?asdasdafa I can handle it with : if(HttpContext.Current.Request.QueryString.HasKeys())
But if my url has QueryString ?asdasasfasdas&brand=Sony then it will fail with null exception because is actually has one key, and the other one doesn’t have it. Is there an easy way to check
if(HttpContext.Current.Request.QueryString.KeysCount ==
HttpContext.Current.Request.QuesryString.ValuesCount))
I don’t think you need to do that, doing a simple null check will suffice
The fact that
asdasdafais not even included as one of the keys on the QueryString won’t make your application throw an Exception.EDIT
Based on the comment, you could then walk through the keys present as so: