title: displaying images from a folder in a gridView ASP.NET
body: <p>How can I display images in GridView from a folder in my project?
  Iv'e tried to create an image/imageField dynamically, but it didn't work- I don't know how to connect the images to the imageField in my GridView, and that's my main problem.
  How can I do it?</p>
  
  <p>Here's my GridView:</p>
  
  <pre><code>            &lt;asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" 
                  Height="271px" onselectedindexchanged="GridView1_SelectedIndexChanged" 
                  style="font-family: Arial, Helvetica, sans-serif" Width="452px"&gt;
                  &lt;Columns&gt;
                      &lt;asp:BoundField DataField="messageSubject" HeaderText="subject" /&gt;
                      &lt;asp:BoundField DataField="messageContent" HeaderText="content" /&gt;
                      &lt;asp:BoundField DataField="wasReadOrNot" HeaderText="was read" /&gt;
                      &lt;asp:ImageField HeaderText="image"&gt;
                      &lt;/asp:ImageField&gt;
                  &lt;/Columns&gt;
              &lt;/asp:GridView&gt;
  </code></pre>
  
  <p>(In addition, it's okay to use imageField at all?)</p>
  
  <p>And here's my Code Behind:</p>
  
  <pre><code>    protected void Page_Load(object sender, EventArgs e)
      {
          Page.MaintainScrollPositionOnPostBack = true;
          if (!IsPostBack)
          {
              WebServiceDBMessages.WebServiceDBMessagesSoapClient dbm = new WebServiceDBMessages.WebServiceDBMessagesSoapClient();
              DataTable dt = dbm.ReturnAllMessagesForTeacher(Session["teacher"].ToString()).Tables[0];
              for (int i = 0; i &lt; GridView1.Rows.Count; i++)
              {
                  if (GridView1.Rows[i].Cells[3].Text == "not read")
                  {
                      //here i want to display image whose url is: "/images/notRead.png"
                  }
                  else
                  {
                        //here i want to display image whose url is: "/images/read.png"
                  }
              }
              GridView1.DataSource = dt;
              GridView1.DataBind();
          }
      }
  </code></pre>
  
  <p>Thanks(:</p>