title: Change the Image size before bind inside Repeater using c# asp.net.
body: <p>I want to change image size before display on view using c# asp.net.I am using Repeater to bind all my data.I am explaining my code below.</p>
  
  <p>index.aspx:</p>
  
  <pre><code>&lt;asp:Repeater ID="rptBannerId" runat="server"&gt;
                   &lt;ItemTemplate&gt;
                      &lt;div class="ls-slide" data-ls="&lt;%# getLs(Container.ItemIndex) %&gt;"&gt;
                         &lt;asp:Image ID="image1" runat="server" ImageUrl='&lt;%# "/Upload/Banner/" + Convert.ToString(Eval("Bnr_Image")) %&gt;' CssClass="ls-bg" /&gt;
                          &lt;div class="intro ls-l" data-ls="&lt;%# getDataLs(Container.ItemIndex) %&gt;" style="left:80%;top:35%;"&gt;
                              &lt;span class="icon fa fa-heart"&gt;&lt;/span&gt;
                              &lt;h2&gt;&lt;span&gt;"&lt;%# getSpanValue(Container.ItemIndex)%&gt;"&lt;/span&gt;"&lt;%# getH2Value(Container.ItemIndex)%&gt;"&lt;/h2&gt;
                              &lt;p&gt;&lt;%# Eval("Bnr_Description")%&gt;&lt;/p&gt;
                              &lt;div class="buttons"&gt;
                                  &lt;a href="" class="prev"&gt;&lt;i class="fa fa-angle-left"&gt;&lt;/i&gt;&lt;/a&gt;
                                  &lt;a href="" class="button"&gt;Read More&lt;/a&gt;
                                  &lt;a href="" class="next"&gt;&lt;i class="fa fa-angle-right"&gt;&lt;/i&gt;&lt;/a&gt;
                              &lt;/div&gt;
                          &lt;/div&gt;
                &lt;/div&gt;
                &lt;/ItemTemplate&gt;
                &lt;/asp:Repeater&gt; 
  </code></pre>
  
  <p>In this page one image is present which is retrieving from database.I need before bind inside Repeater this image properties like width and height will always change to <code>1920*680</code> without losing its quality and then it will display on view page.My code behind page is given below.</p>
  
  <blockquote>
    <p>Index.aspx.cs:</p>
  </blockquote>
  
  <pre><code>using System;
  using System.Collections.Generic;
  using System.Linq;
  using System.Web;
  using System.Web.UI;
  using System.Web.UI.WebControls;
  using System.Data;
  using BusinessLogic;
  namespace Odiya_Doctor_Client
  {
      public partial class index : System.Web.UI.Page
      {
          protected void Page_Load(object sender, EventArgs e)
          {
              indexBL objIndexBL = new indexBL();
              rptBannerId.DataSource = objIndexBL.getBannerData();
              rptBannerId.DataBind();
          }
          protected string getDataLs(int itemIndex)
          {
              if (itemIndex == 0)
              {
                  return "offsetyin:top;offsetxin:0;durationin:2000;offsetyout:bottom;offsetxout:0;durationout:1000;";
              }
              else if (itemIndex == 1)
              {
                  return "scalexin:0.3;scaleyin:0.3;rotatexin:180;offsetxin:0;durationin:2000;durationout:2000;scalexout:2;scaleyout:2;offsetxout:0;fadeout:true;showuntil:3000;";
              }
              else
              {
                  return "skewxin:30;skewyin:0;offsetxin:right;fadein:false;durationin:2000;durationout:1000;offsetxout:right;offsetyout:0;fadeout:true;";
              }
          }
          protected string getLs(int itemIndex)
          {
              if (itemIndex == 0)
              {
                  return "transition2d:9;slidedelay:7000;";
              }
              else if (itemIndex == 1)
              {
                  return "transition2d:40;slidedelay:7000;";
              }
              else
              {
                  return "transition2d:11;slidedelay:7000;";
              }
          }
          protected string getSpanValue(int itemIndex)
          {
              if (itemIndex == 0)
              {
                  return "SYMPTOM";
              }
              else if (itemIndex == 1)
              {
                  return "HELP";
              }
              else
              {
                  return "LAB";
              }
          }
          protected string getH2Value(int itemIndex)
          {
              if (itemIndex == 0)
              {
                  return "CHECKER";
              }
              else if (itemIndex == 1)
              {
                  return "ONLINE";
              }
              else
              {
                  return "TESTING";
              }
          }
      }
  }
  </code></pre>
  
  <p>Please help me to resolve this issue.</p>