title: Return string value in Action to put it in Src of img tag
body: <p>This is my part of View:</p>
  
  <pre><code>&lt;img src="@{Html.RenderAction("GetUserProfileImage", "Home", new { area = "" });}" alt="" /&gt;
  </code></pre>
  
  <p>And My Controller:</p>
  
  <pre><code>    public ActionResult GetUserProfileImage() {
  
          string defaultresult = "http://MyProject.dev/Content/img/sample_user.png";
          if (Member.LogIn()) {
  
              DBFile file = GetMemberPicFromDB();
              return File(file.Content, file.ContentType);
  
          } else {
              return Content(defaultresult);
          }
      }
  </code></pre>
  
  <p>So when I Get File from DB every thing is OK, but when I return URL(by <code>return Content</code>) there is some bad result in rendered html, something like this:</p>
  
  <pre><code>&lt;imghttp: myproject.dev="" content="" img="" sample_user.png="" src="" alt=""&gt;
  
      &lt;div&gt;
          some content from outside of img tag added here
      &lt;/div&gt;
  &lt;/imghttp:&gt;
  </code></pre>
  
  <p>Also I change the View to:</p>
  
  <pre><code>&lt;img src="http://myproject.dev/Content/img/sample_user.png" alt="" /&gt;
  </code></pre>
  
  <p>And every thing is OK,</p>
  
  <p>So where is the problem? it seems return Content can not return simple string to <code>src</code> attribute, So what is your suggestion for return simple string?</p>
  
  <p>if that not possible </p>
  
  <p>I think to get File by URL(<code>http://myproject.dev/Content/img/sample_user.png</code>) and <code>return File()</code> Like when returned from DB, but how can I get the file in controller by this URl(<code>http://myproject.dev/Content/img/sample_user.png</code>) ?</p>
  
  <p>and any other suggestion if you have?</p>