title: how to bind image with specific height and width in repeater control
body: <p>i have repeater control that have specific template for my web site jquery slider. how ever i have table name tbl_Slide_master that have slide details to show. this table have two columns like Img_height and Img_width as int data type for setting image properties in repeater control.
  for further information i include my repeater control</p>
  
  <pre><code>&lt;asp:Repeater ID="SliderRepeater" runat="server"&gt;
                    &lt;ItemTemplate&gt;
                    &lt;li&gt;
                     &lt;p class="img"&gt;&lt;asp:Image ID="Img_Slide" runat="server" ImageUrl='&lt;%# "images/"+ Eval("ImageName")%&gt;' Height='&lt;%#Eval("Img_height")%&gt;' Width='&lt;%#Eval("Img_width")%&gt;'/&gt;&lt;/p&gt;
                     &lt;div class="button"&gt;&lt;span class="right_but"&gt;&lt;img src="images/l_arrow.gif" alt="picture" width="84" height="28" border="0" /&gt;&lt;img src="images/r_arrow.gif" alt="picture" width="84" height="28" border="0" /&gt;&lt;/span&gt;&lt;/div&gt;
                     &lt;h2&gt;&lt;asp:Label ID="lbl_slideheadertext" runat="server" Text='&lt;%# Eval("Header_text")%&gt;'&gt;&lt;/asp:Label&gt;&lt;/h2&gt;
                     &lt;p&gt;&lt;asp:Label ID="lbl_slidetext" runat="server" Text='&lt;%# Eval("Para_text")%&gt;'&gt;&lt;/asp:Label&gt;&lt;/p&gt;
                    &lt;/li&gt;
                    &lt;/ItemTemplate&gt;
                    &lt;/asp:Repeater&gt;
  </code></pre>
  
  <p>when i run my project then error occured like "Specified cast is not valid". it can not evaluate image height and width properties from tbl_slide_master table. how ever when i simple remove Height and Width properties from Image control then Image shows with original h*w.
  is there i have mistake in  Height='&lt;%#Eval("Img_height")%>' and Width='&lt;%#Eval("Img_width")%>...</p>
  
  <p>well i also seen there i can use something like that Height='&lt;%#Eval("Img_height") &amp; "px"%> but also error occurred like "Operator '&amp;' cannot be applied to operands of type 'object' and 'string'"</p>
  
  <p><strong>Updated Solution</strong></p>
  
  <p>ok i have idea i can use html image control so no px needed to join with height and width.</p>
  
  <pre><code>&lt;asp:Repeater ID="SliderRepeater" runat="server"&gt;
                    &lt;ItemTemplate&gt;
                    &lt;li&gt;
                     &lt;%--&lt;p class="img"&gt;&lt;asp:Image ID="Img_Slide" runat="server" ImageUrl='&lt;%# "images/"+ Eval("ImageName")%&gt;' Height='&lt;%# Eval("Img_height")&amp;"px"%&gt;' Width='&lt;%# Eval("Img_width")&amp;"px"%&gt;'/&gt;&lt;/p&gt;--%&gt;
                     &lt;p class="img"&gt;&lt;img id="Img_Slide" src='&lt;%# "images/"+ Eval("ImageName")%&gt;' width='&lt;%#Eval("Img_width")%&gt;' height='&lt;%#Eval("Img_height")%&gt;'/&gt;&lt;/p&gt;
                     &lt;div class="button"&gt;&lt;span class="right_but"&gt;&lt;img src="images/l_arrow.gif" alt="picture" width="84" height="28" border="0" /&gt;&lt;img src="images/r_arrow.gif" alt="picture" width="84" height="28" border="0" /&gt;&lt;/span&gt;&lt;/div&gt;
                     &lt;h2&gt;&lt;asp:Label ID="lbl_slideheadertext" runat="server" Text='&lt;%# Eval("Header_text")%&gt;'&gt;&lt;/asp:Label&gt;&lt;/h2&gt;
                     &lt;p&gt;&lt;asp:Label ID="lbl_slidetext" runat="server" Text='&lt;%# Eval("Para_text")%&gt;'&gt;&lt;/asp:Label&gt;&lt;/p&gt;
                    &lt;/li&gt;
                    &lt;/ItemTemplate&gt;
                    &lt;/asp:Repeater&gt;
  </code></pre>