如何在页面加载中隐藏AspxPopupControl?

时间:2014-04-01 07:55:19

标签: c# asp.net devexpress

当用户角色等于此人时,我想在PageLoad中隐藏Devexpress AspxPopupControl:

protected void Page_Load(object sender, EventArgs e)
{
        if (base.User.IsInRole("Person"))          
        {               
           popup1.ShowOnPageLoad = false;
           popup2.ShowOnPageLoad = false;           
        }
}

但它不起作用!我怎么能隐藏?我不希望User In Role Person显示popup1和popup2。

1 个答案:

答案 0 :(得分:0)

我这样解决了:

aspx

 <table>
 <tr>
 <td id="tdPopup1" runat="server">


  popup control 


</td></tr></table>

C#

  protected void Page_Load(object sender, EventArgs e)
  {

    if (base.User.IsInRole("Person"))          
    {               

       tdPopup1.Visible=false;
    }
  }