In addition to the model itself, I want to pass the product id in the partial model. How to do this?
@Model.product.id
<partial name="_Score" model="@Model.rating"/>
CodePudding user response:
//Create a class and add two properties example like below
` public class Your_Class_Name{
public int CaseId
{
get;set;
}
public string PatientName
{
get;set;
}
//and call your partial view like
@Html.Partial("PartialPatientHeaderDetails", new YourClassName
{
CaseId= @Model.CaseId,PatientName= @havePatientName })
//finally change your return mode in partial View
@model Your_Class_Name
@{
}
@Model.CaseId
@Model.PatientName