title: ASP.NET WebForms: Image Sizemode in Repeater Control
body: <p>Is it possible to display pictures with a non-square aspect ratio in a repeater control element?
  I load images from a datatable with paths as strings.
  But all images are stretched to 450px x 450px.</p>
  <p>Code:</p>
  <pre><code>    &lt;div style=&quot;width: 500px; height: 500px; overflow: auto;&quot;&gt;
          &lt;asp:GridView ID=&quot;GridView1&quot; runat=&quot;server&quot; AutoGenerateColumns=&quot;false&quot; Font-Names=&quot;Arial&quot;&gt;
              &lt;Columns&gt;
                  &lt;asp:TemplateField HeaderText=&quot;IMS-Bilder&quot;&gt;
                      &lt;ItemTemplate&gt;
                          &lt;asp:ImageButton ID=&quot;ImageButton1&quot; runat=&quot;server&quot; ImageUrl='&lt;%# Eval(&quot;Bild-Pfad&quot;)%&gt;'
                              Width=&quot;450px&quot; Height=&quot;450px&quot; Style=&quot;cursor: pointer&quot; ImageAlign=&quot;Middle&quot; /&gt;
                      &lt;/ItemTemplate&gt;
                  &lt;/asp:TemplateField&gt;
              &lt;/Columns&gt;
          &lt;/asp:GridView&gt;
      &lt;/div&gt;
  </code></pre>
  <p>I miss the SizeMode property of WinForms :/
  Maybe someone has a hint for me :)</p>