现在我做了一个页面
xxx.aspx
要是直接在地址栏输入xxx.aspx
执行一个方法
要是输入的是xxx.aspx?id=1
执行的是另一种大概意思就是说如何判断URL有没有带参数(*^__^*) 嘻嘻……

解决方案 »

  1.   

    //带了参数的
    foreach (string type in Request.QueryString)
            {
                type.ToString();            if (type == "MP3")
                {
                    Response.Write("MP3");            }
                else if (type == "MP4")
                {
                    Response.Write("MP4");
                }        }
    //没带参数的
            Response.Write("(*^__^*) 嘻嘻……");我现在页面有没有带参数都会执行没带参数的 带了参数的执行了 但是被没带参数的替代了现在我希望带了参数的时候执行
    foreach (string type in Request.QueryString)
            {
                type.ToString();            if (type == "MP3")
                {
                    Response.Write("MP3");            }
                else if (type == "MP4")
                {
                    Response.Write("MP4");
                }        }没带参数才执行
    Response.Write("(*^__^*) 嘻嘻……");
      

  2.   

    注意:没带参数才才才才才才才才才执行
    Response.Write("(*^__^*) 嘻嘻……");
      

  3.   

    我这次up了就up不了  只能3次  望高手解答……
      

  4.   

    if(Request.QueryString.Count > 0)
    {
        //进行有参数判断
    }
    else
    {
        //进行无参数判断
    }