I am trying to display a partial view in my application and cannot display the value. This is what my view looks like.
My main index
<div id="RPPricingNameModel">
@Html.Partial("RPPricingPlanNames")
</div>
<script type="text/javascript">
$("#RPPricingNameModel").load("/Home/GetPlanNameModel");
</script>
Partial view
@model PlanNameModel
<table style= "vertical-align:top; left:0px; top:0px; position:absolute; border-width:1px; border-style:solid; border-color:Green; width:130px; text-align:left;">
<tr>
<td style=" font-size:15px; font-weight:bold; color:Black;">
@Model.Header
<div>
@Html.LabelFor(x => x.Header)
</div>
</td>
</tr>
<table>
Here is a controller that returns a view.
public ActionResult GetPlanNameModel()
{
PlanNameModel planNameModel = new PlanNameModel();
planNameModel.Header = "Plans";
return PartialView(planNameModel);
}
Here is the code for the model
public class RPPricingPlanNameModel
{
public string Header { get; set; }
}
When I try to display a value in TD, it shows nothing. Could you help me with this?
source
share