[英]Accessing Client-Side arrays on Server Side ASP.Net
I have few int
and string
arrays at client side javascript. 我在客户端javascript上没有几个
int
和string
数组。
How can i access them on server-side in a button click handler of asp.net? 如何在asp.net的按钮单击处理程序中在服务器端访问它们?
A valid approach would be to serialize them and assign it to a runat="server"
hidden field. 一种有效的方法是序列化它们,并将其分配给
runat="server"
隐藏字段。 You'll be able then to access the array deserializing Value
property. 然后,您将能够访问数组反序列化
Value
属性。
You can easily handle serialization with json format or comma separated values. 您可以轻松处理json格式或逗号分隔值的序列化。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.