title: To display the image using asp.net
body: <p>In the below code i have a image stored in C drive and i want to display that image .I tried but i couldn't solve the issue.Pls help me to solve this.</p>
  
  <pre><code>public string strName = "Sample";
          public string strFolder = "Search";
          public string Imgdocname = "Image0529.jpg";
          protected void Page_Load(object sender, EventArgs e)
          {
              string fileExt = ".jpg";
  
              if (fileExt == ".jpeg" || fileExt == ".jpg")
              {
  
                  docimg.ImageUrl = "~/" + strName + "/" + strFolder + "/" + Imgdocname;
                  docimg.Visible = true;
              }
              else
              {
                  docimg.ImageUrl = "~/doc/Documents/image.jpeg";
                  docimg.Visible = true;
              }   }
  
  
  
  &lt;div ID="imgContainer" runat="server" style="width: 700px; height: 300px;  overflow:auto; border: solid 1px black;
                      padding: 10px; margin-bottom: 5px;" &gt;
  &lt;asp:Image ID="docimg" runat="server" /&gt;
  
            &lt;/div&gt;
  </code></pre>