如题,不知道有没有人遇到这样的问题

解决方案 »

  1.   

    "<%=ResolveClientUrl("~/Images/NewEditionImages/infor_1.gif") %>";
    这样看看行不行
      

  2.   

     string rootpath= Request.PhysicalApplicationPath.Substring(0,Request.PhysicalApplicationPath.LastIndexOf('\\'));
           string nowfilepath= Request.PhysicalPath;
           FileInfo filepath = new FileInfo(nowfilepath);
           int depth = 0;
            DirectoryInfo dir=filepath.Directory;
           while (dir.FullName != rootpath)
           {
               depth++;
               dir = dir.Parent;
           }
           Response.Write(depth.ToString());
           string imagepath = "image/1.gif ";
           for (int i = 0; i < depth; i++)
           {
               imagepath = "../" + imagepath;
           }
      

  3.   

    string url="~/image/1.gif";
    protected string URL
        {
            get
            {
                return url.Replace("~","../..");
            }
        }前台:
    <a href="<%=URL%>"><asp:Image ID="Image1" runat="server"  /> </a>