简体   繁体   中英

Server side control hidden - possible to read values client side?

A quick question. I've got two textboxes running server side and have their visibility turned off. I'm using a couple of ASP.NET controls which require the textboxes to exist. However, I am filling them from the code behind and would not like the user to see this. Can the user turn the visibility on and see the values entered in the text box? I tried using FireBug, and I couldn't seem to select the visibility option in order to edit it. However, I'm quite new to Firebug, so there may be another way? Or does running it server side mean that the client can't ever view the contents of the textbox? Thanks

Using the server side property of Visible set to false will cause the controls to not be rendered at all in the browser, which means the user wouldn't have a way to view them in page source or anything.

If however you use CSS display property set to none, the control is actually rendered and just not visible in the browser...although, since it's a server side control, the value would be on the Viewstate which is encrypted and the user would need to be tech savvy to actually get to the control values

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