I am trying to assign a specific width to my image in asp.net (using vb.net).
So I used the next code:
<asp:Image ID="PercentageImage" runat="server" Height="7px"
Width='<%# Eval("votsGraph") %>'
ImageUrl="~/images/bar.JPG" />
So how do i cast this one?
(The type of votsGraph is float.)
Use
CInt():I’ve also added
String.Format()to your code as you were missingpx: