Skip to content
Loading
Partial View replaces Parent view    
  •                 class="col-md-5">    
  •                     @item.Shift    
  •                     
  •                 
  •             class="row">    
  •                 class="col-md-2">    
  •                     Department    
  •                     
  •                 class="col-md-5">    
  •                     @item.Department    
  •                     
  •                 
  •             class="row">    
  •                 class="col-md-2">    
  •                     Group Name    
  •                     
  •                 class="col-md-5">    
  •                     @item.GroupName    
  •                     
  •                 
  •             class="row">    
  •                 class="col-md-2">    
  •                     Start Date    
  •                     
  •                 class="col-md-5">    
  •                     @item.StartDate    
  •                     
  •                 
  •             class="row">    
  •                 class="col-md-2">    
  •                     End Date    
  •                     
  •                 class="col-md-5">    
  •                     @item.EndDate    
  •                     
  •                 
  •             
  •     }    
  • }    
  • I think the possible mistake is returning partial-view on drop down selection changed.
    1. [HttpPost]    
    2.         [ValidateAntiForgeryToken]    
    3.         public ActionResult EmployeeDeptHistory(FormCollection form)    
    4.         {    
    5.             IEnumerable empHistList;    
    6.             using (IDbConnection con = new SqlConnection(connectionString))    
    7.             {    
    8.                 empHistList = con.Query("sp_StoredProc"new { DeptId = form["DepartmentName"] }, commandType: CommandType.StoredProcedure);    
    9.             }    
    10.             return View("_EmployeeDeptHistory", empHistList);    
    11.         }   
    Please help me to figure out my mistake.

    3 Replies

    Know the answer? Post it — somebody with the same question will find it here.