且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

禁用保存按钮

更新时间:2022-06-12 06:22:03





您无法阻止用户保存在浏览器中呈现的HTML内容。但请注意:如果用户保存了一个网页,那么他会保存客户端代码(在浏览器中呈现的HTML代码和一些JavaScript代码)。用户无法保存ASP.NET代码(在.aspx文件中)和代码隐藏文件。



如果你问为什么用户可以不保存ASP.NET代码和代码隐藏文件?。

然后这就是答案:



用户向服务器发送请求,例如用户请求Default.aspx。

然后,ASP.NET网站的服务器将发送响应。服务器不会响应ASP.NET代码或代码隐藏文件,而是使用HTML代码。并且HTML代码在浏览器中呈现。
Hi,

You can''t prevent that the user saves the HTML content that''s rendered in the browser. But note: if the user saves a web page, then (s)he saves the client code (the HTML code that''s rendered in the browser, and some JavaScript code). The user can''t save your ASP.NET code (in the .aspx file) and the code-behind file.

If you ask "Why the user can''t save the ASP.NET code and the code-behind file?".
Then this is the answer:

The user sends a request to the server, for example the user requests Default.aspx.
Then the server of your ASP.NET web site will send a response. The server don''t will respond with ASP.NET code or a code-behind file, but with HTML code. And that HTML code is rendered in your browser.


btnID.Enabled = false;



试试这个....


Try this ....