Click here to Skip to main content
15,892,199 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i have a folder named "images" which contains images.
i have one database created to store the same images. i am displaying these images from database to gridview. now i want to set the link for the images. i.e. if user clicks on the image he will be redirect to the same image in the folder "images" in the new page.
if i am using an hyperlink or image map to display image in the grid view. what should i have to write in the url to redirect the user?
code in c# only.
Posted

1 solution

To accomplish this thing There should be imageName in Database as same as which is in images stored in Local Folder.

Then Simple While Binding use Anchor Tag in the Template Field.

C#
<a href="<%# String.Format("Location of your Folder/{0}",DataBinder.Eval(Container.DataItem,"imageName")) %>"></a>


Hope This Helps,
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900