Pass Value from Controller to View by ViewBag
<p>So I have a controller and I can seem to understand how to pass a parameter to my ActionResult method.</p>

<pre><code>routes.MapRoute(
            name: "MyRoute",
            url: "{controller}/{name}/{id}",
            defaults: new { controller = "Project", name = "Search", id = UrlParameter.Optional }
        );
</code></pre>

<p>This is my route. Now in my controller i've created a method </p>

<pre><code>[HttpGet]
public ActionResult Search()
{
    return View();
}

[HttpPost]
public ActionResult Search(int Id)
{
    ViewBag.iD = Id;
    return View();
}
</code></pre>

<p>And in my view </p>

<pre><code>&lt;body&gt;
    &lt;div&gt;
        ASDF + @ViewBag.iD
    &lt;/div&gt;
&lt;/body&gt;
</code></pre>

<p>How can I pass a value to my iD parameter from Search Action?  It seems whatever I call<br>
<code>http://localhost:52992/Project/Search/id=2</code>
or <code>http://localhost:52992/Project/Search/1</code></p>

<p>Both method go into the Search() method, none goes to Search(int iD).</p>

<p>What Am I missing? </p>