简体   繁体   English

服务器端控件隐藏-可能在客户端读取值?

[英]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. 我正在使用几个需要文本框存在的ASP.NET控件。 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. 我尝试使用FireBug,但似乎无法选择可见性选项进行编辑。 However, I'm quite new to Firebug, so there may be another way? 但是,我对Firebug还是很陌生,所以可能还有另一种方法吗? 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. 将Visible的服务器端属性设置为false会导致控件根本无法在浏览器中呈现,这意味着用户将无法在页面源代码或任何内容中查看控件。

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 但是,如果您将CSS显示属性设置为none,则该控件实际上将呈现,并且在浏览器中不可见...尽管,因为它是服务器端控件,所以该值将位于已加密的Viewstate上,并且用户需要精通技术以真正达到控制值

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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