Home Gitesh Portfolio Blog About Me Gallery Contact
Kentico Certified Developer

Find values of QUERYSTRING in URL with C#

VarURLEventTitle =Request.QueryString["ETitle"]; 
if (!string.IsNullOrEmpty(URLEventTitle))
{
}

OR

if ((URLEventTitle != null) && (URLEventTitle != ""))
{
}

If Request doesn’t work and you get assembly missing error message than add the below system DLL reference:

System.Web.HttpContext.Current.Request.QueryString["ETitle"]; 

Check if any querystring exists or not:

boolCheckQueryString = false;
CheckQueryString = System.Web.HttpContext.Current.Request.QueryString != null&&System.Web.HttpContext.Current.Request.QueryString.Count>0;
if (CheckQueryString)
{
}


Posted: 20/04/2013 11:23:27 p.m. by Gitesh Shah | with 0 comments