在页面执行 response.write(server.mappath(request.applicationpath.tostring()))
打印出来的结果是:D://download/asp.net1
但是用 
response.write("<script>alert('"+server.mappath(request.applicationpath.tostring())+"')</script>")
弹出提示框,则结果是 D:downloadasp.net1  就没有了分隔符,是什么原因?
怎么解决,必须要用response.write("<script>alert('"+server.mappath(request.applicationpath.tostring())+"')</script>")
语句弹出的结果是 D://download/asp.net1  谁能告诉下!
谢谢!

解决方案 »

  1.   

    <Script>alert("D://download/asp.net1 ")</Script>
    测试没问题
      

  2.   

    我想要的记过就是用
    response.write(" <script>alert('"+server.mappath(request.applicationpath.tostring())+"') </script>") 
    弹出的结果是完整的路径.
      

  3.   

    Page.ClientScript.RegisterStartupScript(this.GetType(), "showpath", @"alert('" + Server.MapPath(Request.ApplicationPath).Replace("\\","\\\\") + "');", true);
      

  4.   

    response.write(" <script>alert('"+server.mappath(request.applicationpath.tostring())+"') </script>") 
    改为
    string msg= server.mappath(request.applicationpath.tostring());
    response.write(" <script>alert('"+msg+"') </script>") 
      

  5.   

    string MsgPath=server.mappath(request.applicationpath.tostring()));
    MsgPath=MsgPath.Replace("\\","\\\\"); 
    response.write(" <script>alert('"+MsgPath+"') </script>") 
      

  6.   

    个人建议你尽量不要在CS文件里用response.write去输入
      

  7.   

    简单啊:
    string path = Server.MapPath(Request.ApplicationPath);
    path = path.Replace(@"\",@"\\");
    Response.Write("<script>alert('" + path + "');</script>");good luck!
      

  8.   

    Page.ClientScript.RegisterStartupScript(this.GetType(), "showpath", @"alert('" + Server.MapPath(Request.ApplicationPath).Replace("\\","\\\\") + "');", true);