title: How to access model data in parent partial view
body: <p>I have one controller which will pass data to view Index.cshtml</p>
  
  <pre><code>public ActionResult Index()
      {
          var empId = @User.Identity.Name;
          var empDetails = empRepository.GetEmployeeDetails(empId);
          var emp = new UserViewModel {EmployeeDetail = empDetails};
          return View(emp);
      }
  </code></pre>
  
  <p>Layout of view Index.cshtml is Partialview _Layout.cshtml</p>
  
  <pre><code>@model HRM.Areas.EmployeeDetails.Models.UserViewModel
  @{
         ViewBag.Title = "Index";
         Layout = "~/Areas/EmployeeDetails/Views/Shared/_Layout.cshtml";
   }
  
   &lt;div&gt;Hello&lt;/div&gt;
  </code></pre>
  
  <p>I want to access the data which I passed from controller action to Index.cshtml in _Layout.cshtml.</p>
  
  <p>Is there any way to do this ?</p>