简体   繁体   中英

How to hide AspxPopupControl in Page Load?

I want to hide Devexpress AspxPopupControl in PageLoad when User Role equal to Person like this :

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

But it is not working ! How can I hide ? I dont want User In Role Person display popup1 and popup2 .

I solved like this :

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;
    }
  }

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM