http://localhost/aspx.aspx?id=1&name=2&url=3
用什么函数能获取aspx.aspx 也就是当前文件名啊?
又什么函数能获取id=1&name=2&url=3啊
Request.Url.ToString()这个只能获取http://localhost/aspx.aspx?id=1&name=2&url=3  但是我想分着获取 大家帮帮忙啊

解决方案 »

  1.   

    不是这么获取么?
    Request.QueryString["id"].ToString();
      

  2.   

    汗    不是这样这样我也知道  我想知道获取整段参数的一个函数  就想asp中的这个request.ServerVariables("SCRIPT_NAME")函数一样
      

  3.   

    string str = "id=" + Request.QueryString["id"].ToString();难道是要获取str这种的?还是不太明白~
      

  4.   

    string p = HttpContext.Current.Request.ApplicationPath;
    if (p == "/")
        p = ""; string curPage = this.Request.Path;
    curPage = curPage.Substring(p.Length+1);string urlPar = this.Request.Url;
    urlPar = urlPar.Substring(p.Length+1+curPage.Length+1)
      

  5.   

    <script language=”JavaScript”>
    var urlParts = document.URL.split(“?”);
    var parameterParts = urlParts[1].split(“&”);
    for (i = 0; i < parameterParts.length; i++) { 
    var pairParts = parameterParts[i].split(“=”);
    var pairName = pairParts[0];
    var pairValue = pairParts[1];
    document.write(pairName + “ :“ +pairValue );
    }
    </script> 
      

  6.   

    自己搞定   看和你们写的真麻烦呵呵
    看我的
     HttpContext.Current.Request.ServerVariables["SCRIPT_NAME"];//获取当前页的文件名
            HttpContext.Current.Response.Write(HttpContext.Current.Request.QueryString);直接就行了 呵呵不过还要谢谢你们呵呵
      

  7.   

    终于明白LZ的意思了!!!真不容易~
    你要的page.aspx用JS也可以,只是不知道LZ获取下来要在哪里用Request.ServerVariables("PATH_INFO").Substring(Request.ServerVariables("PATH_INFO").LastIndexOf("/") + 1)string ...接一下跟踪,没编译,你试一下吧~