Click here to Skip to main content
15,896,557 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
how to show image in a gridview from database with a fixed dimension as we want
Posted

1 solution

Refer to this article to show image from database:

http://www.aspsnippets.com/Articles/Display-images-from-SQL-Server-Database-in-ASP.Net-GridView-control.aspx[^]

Set fixed dimension by changing ControlStyle-Width and ControlStyle-Height attributes:
CSS
<asp:ImageField DataImageUrlField = "ID"
DataImageUrlFormatString = "ImageCSharp.aspx?ImageID={0}"
ControlStyle-Width = "100" ControlStyle-Height = "100"
HeaderText = "Preview Image"/>
 
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