Using ASP to judge the parameter of IE address bar

Source: Internet
Author: User
Tags empty html page tostring

In the server-side ASP program can accept the HTML page on the form of the parameters, then how does it achieve ie address parameter judgment?

When the address bar has no parameter "id":

以下是引用片段:
Request.QueryString["ID"]==null
Convert.ToString(Request.QueryString["ID"])==null

Note that this can be an error:

request.querystring["ID"]. ToString ();

When the address bar has a parameter "id" but no value is assigned:

以下是引用片段:
Request.QueryString["ID"]==""
Request.QueryString["ID"]==String.Empty
Convert.ToString(Request.QueryString["ID"])==""
Convert.ToString(Request.QueryString["ID"])==String.Empty

At the same time judge two conditions:

以下是引用片段:
if(""+Request.QueryString["ID"]==""){...}
if((""+Request.QueryString["ID"]).Length==0){...}

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.