如题,谢大家了!
ASP.NET端:          <asp:TableCell Wrap="true" HorizontalAlign="center">
                                                    <asp:Button ID="Btn_Edit" runat="server" Text="编辑" CommandName ="编辑" Font-Size="10px" Height="17" />
                                                    <asp:Button ID="Btn_Particular" runat="server" Text="详细" CommandName ="详细" Font-Size="10px" Height="17"  />
                                                    <asp:Button ID="Btn_Delete" runat="server" Text="删除" CommandName ="删除" Font-Size="10px" Height="17"  />
                                                    <asp:Button ID="Btn_Circulate" runat="server" Text="流通" CommandName ="流通" Font-Size="10px" Height="17"  />
                                                </asp:TableCell>C#端
if (Convert.ToString(Session["权限"] == "浏览权限"))
{
            
}

解决方案 »

  1.   

    在DataGrid的itembond事件里来查看权限,然后让按钮为visable
      

  2.   

    举个简单的例子
    if(无权限)
    {
    Button bt = (Button)e.item.cell[4].findcontrol("Btn_Edit");bt.visable = false;
    }
      

  3.   

    对了,这个(Button)e.item.cell[4].findcontrol("Btn_Edit"); 中的e是什么东东,在Page_Load中没有找到!
    错误 1 “Button”是“System.Web.UI.WebControls.Button”和“System.Windows.Forms.Button”之间的不明确的引用 D:\cosmetics\query\EnterpriseInfoSelect.aspx.cs 56 13 D:\cosmetics\
    错误 2 “Button”是“System.Web.UI.WebControls.Button”和“System.Windows.Forms.Button”之间的不明确的引用 D:\cosmetics\query\EnterpriseInfoSelect.aspx.cs 56 27 D:\cosmetics\
    错误 3 “System.EventArgs”并不包含“item”的定义 D:\cosmetics\query\EnterpriseInfoSelect.aspx.cs 56 36 D:\cosmetics\
      

  4.   

    刚才改了一小下,后来只剩下第三种错误了!
            if (Convert.ToString(Session["权限"]) == "浏览权限")
            {
                System.Web.UI.WebControls.Button BTe = (System.Web.UI.WebControls.Button)e.item.cell[4].findcontrol("Btn_Edit");            BTe.Visible = false;
            }
    “System.EventArgs”并不包含“item”的定义 D:\cosmetics\query\EnterpriseInfoSelect.aspx.cs 56 36 D:\cosmetics\