This is something to do with the Request.QueryString () function.
You can use the following piece of code to check the existence of a query string variable.
if (Request.QueryString["[VariableName]"] != "")
{
// Do something
}
One of the problem with the above query is ,if the variable was not present in the query string ,the If statement will return a true and the code inside the IF will get executed .
So we need to use the following code to overcome this .
if (Request.QueryString["[Variable Name]"] != "" && Request.QueryString["[VariableName]"] != null)
{
// do something
}
This code will check the existence of the variable name specified in the query string and also if it contains a value or not.
Hope this helps !
Great Article
ReplyDelete.net training online | C# Online Training | Dot Net Training in Chennai | .Net Training in Chennai | ASP.NET Training | ASP.NET MVC Training | Dot Net Interview Questions| ASP.NET Training | ASP NET Training
Excellent and very cool idea and the subject at the top of magnificence and I am happy to this post. Interesting post! Thanks for writing it.You can also visit here .net corporate training gurgaon.
ReplyDeleteThanks
ReplyDeleteencapsulation in java with realtime example