日期:2014-05-17 浏览次数:20488 次
<td>
<div id="admin">管理
<%# Eval(getPower()) == "1" ? "显示div'admins'": "隐藏div"%>
<div id="admins">
<asp:LinkButton ID="LinkBtn_delete" CommandArgument='<%#Eval("T_id") %>' runat="server" CommandName="1">删除</asp:LinkButton><br />
<asp:LinkButton ID="LinkBtn_top" CommandArgument='<%#Eval("T_id") %>' runat="server" CommandName="2">置顶</asp:LinkButton><br />
<asp:LinkButton ID="LinkBtn_un_top" CommandArgument='<%#Eval("T_id") %>' runat="server" CommandName="3">取消置顶</asp:LinkButton>
</div>
</div>
</td>
public string getPower() { string name = Session["username"].ToString(); string signer = new UserManager().getUserByName(name).U_signer; if (signer == "1") { return "1"; } else{turn "0";} }
<%if (Eval(getPower()) == "1")
{%>
<div id="admins">
<asp:LinkButton ID="LinkBtn_delete" CommandArgument='<%#Eval("T_id") %>' runat="server" CommandName="1">删除</asp:LinkButton><br&nb