Click here to Skip to main content
15,884,177 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Dear all

Please help to implement one logic

I have a varbinary(max) column in sql server database
and i am fetching it through datareader
If suppose i am getting 2 records
then i want to create 2 link buttons dynamically and on click of it anytime i want to display particular image
Posted
Updated 6-Jan-12 19:41pm
v2

try this
take image control
C#
<img  runat="server" id="image" />

And in code behind do this:

C#
image.src="data:image/png;base64,"+Convert.ToBase64String(imageBytes);


you can also try
http://forums.asp.net/p/1379716/2913448.aspx
 
Share this answer
 
v2
Comments
mayur csharp G 7-Jan-12 2:37am    
src is what?
uspatel 7-Jan-12 10:52am    
src is path of image file
1. Fetch records from SQL
2. Iterate a for loop with fetched records count
a. create ASP Link button control
b. enable OnClick event of control with loaded image

On running this logic, you will resolve the problem.
 
Share this answer
 
Comments
mayur csharp G 7-Jan-12 2:33am    
not getting dear

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