Find Count the number of parameters of a query string in asp.net using c#

protected void Page_Load(object sender, EventArgs e)
{

Int16 totalParameters;
if (!Page.IsPostBack)
{
totalParameters = Request.QueryString.AllKeys.Length;
Response.Write("The number of parameters the query string contains are "+totalParameters);
}
}

The Request.QueryString.AllKeys.Length will give you what you want

0 comments:

Post a Comment