MVC 根据model.status判断是否显示button
View页面:
@model ViewModels
<div>
@if(Model.Status!=1)
{
<asp:Button id="btnPublish" Text="Submit" runat="server" />
<asp:Button id="btnSaveDraft" Text="Submit" runat="server" />
}
@if(Model.Status==1)
{
<asp:Button id="btnSave" Text="Submit" runat="server" />
}
</div>