is there any way i can assigned an imageurl to html img tag from database like … something like that or i can assign image url to html img tag from code behind like imgCaravan.ImageUrl= “~/images/” + rdr[“image”].ToString();
As I am using a image swapping jquery which uses html tag to display images . The issue is I am getting the image url from the database , i just cant find a way to pass the url to html tag, I can do this by using asp image control.
Any help or tutorials will be appreciated
thnx
If I unrderstand well you search for the
img10.Attributes["src"]="/photofile.gif", to make this running you also need to add therunat="server" id="img10"on your<imgtag.How ever I suggest to add a literal in the place that you like to display the image, and just make a full render of the img tag.
Eg:
<asp:literal runat="server" id="img10" />and then just set your imageimg10.Text = "<img src="/imgafilename.gif" alt="" />"