Image Control in ASP.NET [Resolved]

Posted by .Netlearner under ASP.NET on 8/14/2012 | Points: 10 | Views : 922 | Status : [Member] | Replies : 2
I have mentioned the imageurl in my codebhind file.The path is right , one time i viewed the image too but most of the time am unable to view image in my image control.How i can solve this.Where am going wrong ?

imgmap.ImageUrl = Server.MapPath((".\\Maps\\") + ds.Tables[0].Rows[i]["Map"].ToString());





Responses

Posted by: Ranjeet_8 on: 8/14/2012 [Member] [MVP] Gold | Points: 50

Up
0
Down

Resolved
Try this,

imgmap.ImageUrl = "~/Maps/" + ds.Tables[0].Rows["Map"].ToString();


.Netlearner, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: .Netlearner on: 8/14/2012 [Member] Starter | Points: 25

Up
0
Down
Thanks a lot its working. Is that wrong that also mentions the correct path only na

.Netlearner, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response