Hi guys...i am displaying some html images on the web page dynamically...i want to add an tag to that image so that the user would be able to click on the image and navigate...
How can we add a tag in C# code
Hi guys...i am displaying some html images on the web page dynamically...i want to add an tag to that image so that the user would be able to click on the image and navigate...
How can we add a tag in C# code
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Niradhip ChakrabortyPosted Mar 25, 2009, 2:06 PM
HTML code:
c# code:
now you can fetch all the images path which is stored in database and put it on a dataset and loop through it and assign the appropriate imagepath.
imgEvent4.ImageUrl = dstEvents.Tables["Events"].Rows[intIndex]["evm_txt_EventImagePath"].ToString();
for onclick option you can go for javascript.
c# code:
trEvent4.Attributes.Add("onclick", "ImageClick();");
javascript code:
function ImageClick()
{
location.href = "Image1.aspx";
return false;
}
Vipul KelkarPosted Mar 25, 2009, 1:06 PM
Soory dude...not workin
No need o using toolbox...I have taken an array of 'image' control as i have to add the images dynamically...How can i navigate on the click of an image
there is no property for an image control as postbackurl...
Help me out..its urgent
Posted Mar 25, 2009, 6:10 AM
Use ImageButton in the toolbox option and in Properties of it....use
ImageUrl-The Image u want to display
PostbackUrl-The page u want to navigate to...
Hope it Helps.........