title: MVC get img url from controller
body: <p>I am creating a simple page which loads an image from the server folder but the image is not showing up.</p>
  
  <p>Here is my code:</p>
  
  <p>JavaScript:</p>
  
  <pre><code>&lt;script src="~/contents/css/jquery-1.11.3.min.js"&gt;&lt;/script&gt;
  &lt;script&gt;
  
      $(document).ready(function () {
  
          setInterval(function () { getimg() }, 3000);
  
          /* code here */
      });
      function getimg(){
  
          $.ajax({
              url:"/Promotion/imageName",   
            type: 'Post',
            success: function (result) {
  
            },
            error: function (result) {
            }
        });
      };
  
  
  &lt;/script&gt;
  </code></pre>
  
  <p></p>
  
  <p>HTML:</p>
  
  <pre><code>&lt;body&gt;
    &lt;div&gt;
  
      &lt;img src="@Url.Content("~/misc/uploads/"+Url.Action("imageName"))" /&gt;
    &lt;/div&gt;
  &lt;/body&gt;
  </code></pre>
  
  <p>This is my controller to get the image name. My view page is Index page:</p>
  
  <pre><code> public ActionResult imageName() 
      {
          string imgName ="chrysanthemum.jpg";
          return Content(imgName);
  
  
      }
  </code></pre>