Click here to Skip to main content
15,892,517 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I have a image in Grid View and i want to set the maximum size(resolution) of that, i want to keep the size auto but also fix the maximum size. How can i do this?
Posted
Updated 30-Aug-17 1:31am
v2
Comments
Richard C Bishop 11-Apr-13 12:27pm    
You cannot have your cake and eat it too.

You can set the maximum size in CSS:
CSS
img.InGrid
{
max-width: 50px;
max-height: 50px;
}

It will let the image auto-size until it reaches one of those dimensions.
 
Share this answer
 
set a style for the image

<asp:Image ID="Image1" runat="server" style="max-height:1000px;max-width:900px;height:auto;width:auto;" />
 
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