Click here to Skip to main content
16,012,028 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
How can i display clickable images stored in a folder and image information data from a database like sql server on a page using gridview in asp.net
Posted

1 solution

Hi IRFAN3132!

you have to do this at the RowDataBound event of your GridView

( http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.gridview.rowdatabound.aspx[^] )

This event are called for every row in the datasource.

There insert the logic to put "" html tags before and after of your image.

At the tag you can choice from the "target" attribute or call a jQuery/javascript with the "onclick" attribute.

Other way is to put an ImageButton into the grid and bind it. But you will get a postback at click.

I hope this help.
bye
 
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