代码如下:public string UTypeCD = "", UTypeNM = "", FilePath = "";
protected void Page_Load(object sender, EventArgs e)
{
FilePath = System.Web.HttpContext.Current.Server.MapPath("/Files/Voteh/201211/");
}
<input id="FilePath" type="hidden" value="<%=FilePath %>" />
IIS:在默认网站下建立一个 虚拟目录A现在 在VS中直接运行的话以上路径是对的。
但是通过IIS:http://xxx.xx.xx.xx/A 进行访问的话,FilePath的路径在默认网站下,怎么不是虚拟目录A下?
protected void Page_Load(object sender, EventArgs e)
{
FilePath = System.Web.HttpContext.Current.Server.MapPath("/Files/Voteh/201211/");
}
<input id="FilePath" type="hidden" value="<%=FilePath %>" />
IIS:在默认网站下建立一个 虚拟目录A现在 在VS中直接运行的话以上路径是对的。
但是通过IIS:http://xxx.xx.xx.xx/A 进行访问的话,FilePath的路径在默认网站下,怎么不是虚拟目录A下?
这样才能兼容虚拟目录和真实的网站。
及 单独的JS文件中呢: xmlhttp.open("POST", "../Item.aspx?now=" + now + "&type=getTime", false);
xmlhttp.send(null);
取不到../Item.aspx。。
我还是对这个 虚拟路径 头大