In my ASP.net MVC3 Razor project .I have to implement partial Page inside a normal view page ,but enable only after the action calls.But both files are referencing a single view model. How to use partial page inside a View page.
Controller Code for Partial Page
//View Customer Data Detailed
public ActionResult DetailedData(int CusId)
{
var data = from c in cus.CusModelData
where c.CusId == CusId
select c;
return View(data.ToList());
}
View Code
<td>
@* @Html.ActionLink("Edi", "Edit", new { id = item.CusId }) |*@
@Html.ActionLink("Details", "DetailedData", new { CusId = item.CusId }) |
@Html.ActionLink("Delete", "DeleteCustomer", new { CusId = item.CusId })
</td>
Controller Code for View Page
[HttpPost]
public ActionResult ViewCutomerData(string Name)
{
var data = from c in cus.CusModelData
where c.Name.Contains(Name)
select c;
return View(data.ToList());
}
Right now i am using like this inside view page
View Customer Data Details
@(Html.Partial("DetailedData")
But again it displaying the table data in the View page .But i want to display it only after the "Details" Link is clicked.
