避免图片路径访问405,可以用图片控件来显示局部相对路径,不需要域名就不会出现jpg静态资源访问错误

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
<asp:Image ID="Image1" runat="server"/>
 
 
 protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                if (string.IsNullOrEmpty(Request.Params["CarPicPath"]) == false)
                {
                    string CarPicPath = Request.Params["CarPicPath"];
                    Image1.ImageUrl = CarPicPath;               
                }
            }
        }
 
避免图资料405,可以用图片控件来显示后缀路径,不需要域名就不会出现jpg静态资源访问错误

  

1
CarPicPath  = "/updload/img/20xxxxxx/xxxxxxx.jpg";
posted @   hi-latolo  阅读(602)  评论(0编辑  收藏  举报
努力加载评论中...
点击右上角即可分享
微信分享提示