简体   繁体   中英

how to hide asp.net login control 's Remember me checkbox and Remember me text in code behind based on a condition?

I am trying to hide Remember me checkbox on page load event based on a value of a parameter. If the value of parameter is true , the checkbox and Remember me next time text is displayed otherwise it should be hidden from the page. I am using the layout template of the asp.net login control. I have tried using display :none on the checkboxstyle but the checkbox gets hidden only when this is done in aspx page . I have set Display Remember me = false, REmember me text = "" , nothing seems to work.

Thanks guys and sorry for not posting the code. I figured it out. CheckBox cek = (CheckBox)Login1.FindControl("RememberMe"); cek.Visible=false;

is the solution which hides the checkbox and its text from codebehind. Good luck

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