title: ASP MVC - ViewBag from partial to view
body: <p>i need set property of ViewBag in partial view and call in view. Here is my code:
  This is <code>index.cshtml</code>:</p>
  
  <pre><code>&lt;h2&gt;@ViewBag.Title&lt;/h2&gt;
  Html.RenderPartial("~/Views/Article/Partial.cshtml");
  </code></pre>
  
  <p>And this controller:</p>
  
  <pre><code>public ActionResult Index(int id)
  {
    return View(_db.Articles.Find(id));
  }
  </code></pre>
  
  <p>This is <code>Partial.cshtml</code>:</p>
  
  <pre><code>@model Article
  @{
      ViewBag.Title = Model.Article.Title;
  }
  
  &lt;h2&gt;....&lt;/h2&gt;
  //html...
  </code></pre>