'How to send two parameters in a partial model?
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"/>
Solution 1:[1]
//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
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Vedika Juyal |
