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>

posted @ 2017-01-09 09:42  笑语载歌  阅读(387)  评论(0编辑  收藏  举报