Hello Everyone! I have a repeater control on application where I have to use 3 buttons and these buttons should be displayed when any specific user logged on...user could be like Admin or Operator.. Please help with sample of code.. Thanks in advance!!!
We use cookies to ensure you have the best browsing experience on our website. By using our site, you
acknowledge that you have read and understood our
Cookie Policy &
Privacy Policy.
Try this code...might help you...
if(Roles.IsUserInRole("operator")) { Button save=(Button)rptSample.Items[0].FindControl("btnSave"); save.Visible = true; Button update= (Button)rptSample.Items[0].FindControl("btnUpdate"); update.Visible = true; }