title: Is it possible to return a View from a Controller method that is not the Index?
body: <p>I'm currently getting started with MVC, but I can't seem to manipulate my view with my controller if I'm not using...</p>
  
  <pre><code>public ActionResult Index() { 
      return View();
  }
  </code></pre>
  
  <p>When I use a function that is not Index() to attempt to update, it seems as if the page is not changing at all.  In fact, it seems like the page steps into all of the expected controller and partial view calls, but then just loads the default page anyway.  I think I'm doing something wrong in how I'm communicating with my view.</p>
  
  <p>Here is my current process:</p>
  
  <p>Created the view with controls.  I want my user to enter search data, click the search button, and begin my query to retrieve results.  The results will be displayed in a web grid once they are retrieved.</p>
  
  <pre><code>    &lt;div class="searchOneWrp"&gt;
          &lt;fieldset&gt;
              &lt;legend&gt;&lt;strong&gt;Patient One Search&lt;/strong&gt;&lt;/legend&gt;
              First Name: &lt;input type="text" id="fnamePone" /&gt;
              Last Name: &lt;input type="text" id="lnamePone" /&gt;
              D.O.B.: &lt;input type="text" id="dobPone" /&gt;
              &lt;button class="patient_look_up_button" id="btnPOneSearch" name="btnPOneSearch" type="submit" onclick="patientOneSearch()"
                      title="Search"&gt;
                  Search
              &lt;/button&gt;
          &lt;/fieldset&gt;
          @if (Model != null &amp;&amp; Model.Count() &gt; 0)
          {
              Html.RenderPartial("PatientOneSearch");
          }
      &lt;/div&gt;
  </code></pre>
  
  <p>My model:</p>
  
  <pre><code>namespace myNameSpace.Repository.Model
  {
      public class PatientMerge
      {
          public int pat_id { get; set; }
          public string pag_status_cn { get; set; }
          public string fname { get; set; }
          public string lname { get; set; }
          public string birth_date { get; set; }
          public string AgeYears { get; set; }
          public string gender_cd { get; set; }
          public string phone_no { get; set; }
          public string addr1 { get; set; }
          public string addr2 { get; set; }
          public string city { get; set; }
          public string state_cd { get; set; }
      }
  }
  </code></pre>
  
  <p>My AJAX gets to my Controller for my query:</p>
  
  <pre><code>        public PartialViewResult GetPatientOneSearch(string fname, string lname, string dob)
          {
              try
              {
                  var target = new PatientRepository();
                  var result = target.GetPatient(fname, lname, dob, "", "", "");
                  List&lt;myNameSpace.Repository.Model.PatientMerge&gt; patientList = new List&lt;myNameSpace.Repository.Model.PatientMerge&gt;();
  
                  for (int i = 0; i &lt; result.Count; i++)
                  {
                      myNameSpace.Repository.Model.PatientMerge patient = new myNameSpace.Repository.Model.PatientMerge();
                      patient.pat_id = result[i].PatientId;
                      patient.fname = result[i].FirstName;
                      patient.lname = result[i].LastName;
                      patient.birth_date = result[i].DateOfBirth.ToString();
  
                      patientList.Add(patient);
                  }
                  return PartialView("PatientOneSearch", patientList);
              }
              catch (Exception ex)
              {
                  Logger.Log.Error(ex.Message + ex.StackTrace + ex.InnerException);
                  //return Json(new { error = ex.Message }, JsonRequestBehavior.AllowGet);
                  return PartialView("PatientOneSearch", null);
              }
          }
  </code></pre>
  
  <p>Which then goes to my Partial View...</p>
  
  <pre><code>@model IEnumerable&lt;myNameSpace.Repository.Model.PatientMerge&gt;
  
  &lt;div id="grdPatientOneSearch"&gt;
      @if (Model != null &amp;&amp; Model.Count() &gt; 0)
      {
          var grid = new WebGrid(Model);
          grid.GetHtml(tableStyle: "webgrid",
          headerStyle: "header",
          alternatingRowStyle: "alt",
          selectedRowStyle: "select",
          columns: grid.Columns(
          grid.Column("pat_id", "Id"),
          grid.Column("fname", "First Name"),
          grid.Column("lname", "Last Name"),
          grid.Column("birth_date", "dob")
          )
          );
      }
      else
      {
          &lt;label&gt;No records found.&lt;/label&gt;
      }
  </code></pre>
  
  <p></p>
  
  <p>Aaaaaand nothing displays on in my browser.  In fact, with all the testing I've done, I swear it just returns the default view.  It does not actually hit my return View(); above, but from all the testing I've attempted to do in the last 2 days, I swear that has to be what is happening.</p>
  
  <p>Am I doing something wrong in how I'm updating my view?</p>