title: MVC Search Code
body: <p>Hello guys i hope you all are doing great, so i am working on a project with my buddy but we both are intermediate programmers and stuck into a place so i need your help...</p>
  
  <p>the problem is I'm stuck in a certain code which is for "search the dish":  </p>
  
  <p><a href="https://i.stack.imgur.com/7UUga.jpg" rel="nofollow noreferrer">ShowAll list page</a></p>
  
  <p><a href="https://i.stack.imgur.com/25atE.jpg" rel="nofollow noreferrer">After selecting value from a combo box</a></p>
  
  <p>it's doing post back from java script method as you can see in the picture but i think my code is incomplete because i can't get value from database i is showing the list on my "ShowAll page" but when i choose a value from combo box it doesn't show anything..</p>
  
  <p><strong>ActionResult Code</strong></p>
  
  <pre><code>public ActionResult ShowAll()
      {
  
          var a = from tb in me.RecipeTables select tb;
  
          return View(a.ToList());
      }
  
      [HttpPost]
      public ActionResult ShowAll(string searchDish)
      {
          var k = me.RecipeTables.Where(l =&gt; l.recipeName == searchDish);
          return View(k);
      }
  </code></pre>
  
  <p><strong>View Code wit java script function</strong></p>
  
  <pre><code>&lt;html&gt;
  </code></pre>
  
  <p>
      </p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
      function SelectedIndexChanged()
      {
          this.myForm.submit();
      }
  &lt;/script&gt;
  </code></pre>
  
  <p>
  </p>
  
  <pre><code>&lt;%using (Html.BeginForm("ShowAll", "RecipeView", FormMethod.Post, new { id = "myForm", name = "myForm", enctype="multipart/form-data"}))  
   %&gt;
  &lt;p&gt;
      &lt;%: Html.ActionLink("Create New", "Create") %&gt;
      &lt;select id="searchDish" name="searchDish" onchange="SelectedIndexChanged()"&gt;
          &lt;option value="0"&gt;Select any&lt;/option&gt;
          &lt;option value="1"&gt;biryani&lt;/option&gt;
          &lt;option value="2"&gt;fried rice&lt;/option&gt;
          &lt;option value="3"&gt;Nihari&lt;/option&gt;
          &lt;option value="4"&gt;Tikka&lt;/option&gt;
      &lt;/select&gt;
  &lt;/p&gt;
  </code></pre>
  
  <p>need help!!! thanks in advance </p>