show image usin binding problem
-
hi i want to show my image using binding in a datalist: ImageUrl='<%#GetImgPicUrl(DataBinder.Eval(Container.DataItem, "url"))%>' runat="server" CssClass="newStyle1" /> and : public string GetImgPicUrl(object url) { string strUrl = Server.MapPath(@"~/Attachment/picture/" + url.ToString()); return strUrl; } it show image on my pc but on server it dosnt show. whats problem?
sepel
-
hi i want to show my image using binding in a datalist: ImageUrl='<%#GetImgPicUrl(DataBinder.Eval(Container.DataItem, "url"))%>' runat="server" CssClass="newStyle1" /> and : public string GetImgPicUrl(object url) { string strUrl = Server.MapPath(@"~/Attachment/picture/" + url.ToString()); return strUrl; } it show image on my pc but on server it dosnt show. whats problem?
sepel
-
hi i want to show my image using binding in a datalist: ImageUrl='<%#GetImgPicUrl(DataBinder.Eval(Container.DataItem, "url"))%>' runat="server" CssClass="newStyle1" /> and : public string GetImgPicUrl(object url) { string strUrl = Server.MapPath(@"~/Attachment/picture/" + url.ToString()); return strUrl; } it show image on my pc but on server it dosnt show. whats problem?
sepel
sepel wrote:
string strUrl = Server.MapPath(@"~/Attachment/picture/" + url.ToString());
This return a local path as c:\... What you need is a web url like http://... Use this:
ImageUrl='<%# Eval("url", "~/Attachment/picture/{0}")%>'
or
ImageUrl='< DataBinder.Eval(Container.DataItem, "url", "~/Attachment/picture/{0}"))%>'Alexei Rodriguez
-
sepel wrote:
string strUrl = Server.MapPath(@"~/Attachment/picture/" + url.ToString());
This return a local path as c:\... What you need is a web url like http://... Use this:
ImageUrl='<%# Eval("url", "~/Attachment/picture/{0}")%>'
or
ImageUrl='< DataBinder.Eval(Container.DataItem, "url", "~/Attachment/picture/{0}"))%>'Alexei Rodriguez