Click here to Skip to main content
15,891,431 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
HI,

i have faced a question in interview...........

that is how to set a image size in gridview or datalist..

Q)what is the code for setting a image should be fixed it should not extend to webpage or all sizes should be in same size???
pls give me answer for this question...
Posted
Comments
Nilesh Patil Kolhapur 21-Feb-12 6:32am    
Explain more
Maheshdotnet2010 21-Feb-12 11:06am    
Thank you very much......................
Vasim889 21-Feb-12 8:22am    
set properties for image button height="100px",width="100px"
Maheshdotnet2010 21-Feb-12 11:06am    
Thank you so much.............

1 solution

You will always have the same width and Height image in the Gridview and datalist

<columns> 
<asp:templatefield xmlns:asp="#unknown">    
<itemtemplate>
<img src="images\<%Eval(" imagepath=")%>" height="200px" width="300px" />
</itemtemplate>
<asp:templatefield>
</asp:templatefield></asp:templatefield></columns>
 
Share this answer
 
Comments
Maheshdotnet2010 21-Feb-12 11:05am    
Thank u ......................very much..........

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