如何通过从Asp.net服务器端阵列JavaScript函数在客户端 [英] How to pass array from Asp.net server side to Javascript function on client side
问题描述
我如何通过我已经使用Javascript在服务器端建立到进行操纵客户端数组?
How do I pass an array I have created on the server side onto the client side for manipulation by Javascript?
任何伪code将有助于
Any pseudo code will help
推荐答案
您将需要嵌入它作为一个javascript数组声明到页面中。有许多方法可以做到这一点,但它通常是指将数组成文本,你写的页面,可能使用ClientScriptManager
You'll need to embed it as a javascript array declaration into the page. There are a number of ways to do this, but it generally means turning the array into text that you write to the page, probably using the ClientScriptManager.
我希望在ASP.Net的即将到来verison更好的JavaScript集成。移动服务器变量&MDASH的的值的;任何服务器变量—到客户端应用一个简单的一行的函数调用来支持。不背翻转,我们现在需要的。
I'm hoping for better javascript integration in a upcoming verison of ASP.Net. Moving the value of a server variable —any server variable— to the client ought to be supported with a simple, one-line function call. Not the back-flips we need right now.
这篇关于如何通过从Asp.net服务器端阵列JavaScript函数在客户端的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!