title: ASP.NET MVC - View with multiple models
body: <p>I am trying to generate such HTML</p>
  
  <pre><code>    &lt;form action="/some/process" method="post"&gt;
          &lt;input type="hidden" name="foo.a" value="aaa"/&gt;
          &lt;input type="hidden" name="bar.b" value="bbb"/&gt;
          &lt;input type="submit" /&gt;
      &lt;/form&gt;
  </code></pre>
  
  <p>so it can be processed by this Action:</p>
  
  <pre><code>    public ActionResult Process(Foo foo, Bar bar)
      {
          ...
      }
  </code></pre>
  
  <p>Given the Action code</p>
  
  <pre><code>    public ActionResult Edit()
      {
          ViewData["foo"] = new Foo { A = "aaa" };
          ViewData["bar"] = new Bar { B = "bbb" };
  
          return View();
      }
  </code></pre>
  
  <p>what should I write in Edit.aspx view? I don't want to write names 'foo.a' and 'bar.b' manually.</p>