JavaScript and ASP.NET

xiaoxiao2021-03-06  22

JavaScript and ASP.NET

Author: Chen edge Contact: luandao2000@gmail.com blog: http: //blog.9cbs.net/luandao2000 home page: http: //www.spbase.com

Due to the needs of the project, it has a certain understanding of JS development in recent time. 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-65533.html

New Post(0)