title: How to prevent a page gets refreshed?
body: <p>I have <code>DropDownList</code> and a submit button on my page. <code>DropDownList</code>has list of data from the database, and while selecting value from the dropdown and then clicking on submit button, I am getting number of records of selected dropdown list value in partial view of the main view page. My code is giving proper output. I have bind View to controller through model. Using html.hiddenfor.
  But whenever I click on submit button as usual my whole page gets refreshed. But I need to refresh only partial view rather than whole page. </p>
  
  <p>This is my code which is working properly. But by this code my whole page is getting refreshed. And I want to prevent it. :</p>
  
  <p><strong>view:</strong></p>
  
  <pre><code>&lt;%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage&lt;ApricaCRMEvent.Models.CRM.DatabaseEntities.CRM_Doctor_Request&gt;" %&gt;
  
  &lt;asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server"&gt;
      MDLNoDDLIndex
  &lt;/asp:Content&gt;
  
  &lt;asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server"&gt;
  
      &lt;script type="text/javascript"&gt;
          function TestFun() {
              var mdlno = $("#ddlMDLNo").val();
              var txtmdlno = document.getElementById("Request_For_Id");
              txtmdlno.value = mdlno;
          }
  &lt;/script&gt;
  
  &lt;div&gt;
  &lt;h2&gt;Search by MDLNo&lt;/h2&gt;
       &lt;% using (Html.BeginForm())
          { %&gt;
  
          Select MDLno 
  
          &lt;%= Html.DropDownList("ddlMDLNo", ViewData["MDLno"] as SelectList, "--Select One--", new { onchange = "TestFun()" })%&gt; 
          &lt;%: Html.HiddenFor(model =&gt; model.Request_For_Id) %&gt; 
  
           &lt;input type="submit" value="search" name="SearchMDLNo" id="btnclick" /&gt;    
      &lt;% } %&gt;
  &lt;/div&gt;
  &lt;div id="showtable"&gt;   //partial view
  &lt;% if (ViewBag.load == true)
     { %&gt;
      &lt;%Html.RenderAction("MDLNoDataList"); %&gt;
  &lt;% } %&gt;
  &lt;/div&gt;
  
  &lt;/asp:Content&gt;
  </code></pre>
  
  <p><strong>Controller:</strong></p>
  
  <pre><code>// Search by mdl no
          public ActionResult MDLNoDDLIndex()
          {
              ViewData["MDLno"] = new SelectList(CRMSearchReportDL.getAllMDLno(), "Request_For_Id", "Request_For_Id");
              ViewBag.load = false;
              return View();
          }
  
          [HttpPost]
          public ActionResult MDLNoDDLIndex(CRM_Doctor_Request model)
          {
              ViewData["MDLno"] = new SelectList(CRMSearchReportDL.getAllMDLno(), "Request_For_Id", "Request_For_Id",model.Request_For_Id);
              ViewBag.load = true;
              return View();
          }
  
  
          public ActionResult MDLNoDataList()
          {
              List&lt;CRM_Doctor_Request&gt; drlist = new List&lt;CRM_Doctor_Request&gt;();
              return PartialView(drlist);
          }
          [HttpPost]
          public ActionResult MDLNoDataList(CRM_Doctor_Request model)
          {
              return PartialView(CRMSearchReportDL.getMDLNoWiseDetails(model.Request_For_Id));
          }
  </code></pre>