[Transfer] JavaScript and ASP.NET

xiaoxiao2021-03-06  38

Author: Chen edge Contact: luandao2000@21cn.com website: http: //blog.9cbs.net/luandao2000 due to the project needs, the most recent period for the development of js have a certain understanding. In the development of ASP.NET, often requires JS scripts to add some client control, such as restricting input characters, date controls, and more. Generally, such control is substantially better in the client, no need to return to the server. Summarized some of the JS skills used in the recent development, providing it to everyone. Document.all ('Name'). Value; 2, how the server controls take the value of the Variables in JS Currently no better way, I usually use the method to put a hidden control HTMLINPUTHIDDEN on the interface, and then set to Server control runs so that you can access the value js of the control in the JS script and the ASP.NET code to assign the value of the control: var bt = document.all ('name'). Value; bt.value = 'name '; Use name.value in ASP.NET to access. 3, how to traverse all TextBox elements VAR inputlist = document.body.getlementsBytagname ("Input"); for (var i = 0; I

转载请注明原文地址:https://www.9cbs.com/read-63296.html

New Post(0)