简体   繁体   English

在服务器端ASP.Net上访问客户端阵列

[英]Accessing Client-Side arrays on Server Side ASP.Net

I have few int and string arrays at client side javascript. 我在客户端javascript上没有几个intstring数组。

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.

相关问题 ASP.NET客户端与服务器端验证 - ASP.NET Client-side vs Server-side Validation 从服务器端asp.net注册客户端json的有效方法? - Efficient way to register client-side json from server-side asp.net? 如何在 ASP.NET Core 3.1 MVC 中进行RequiredIf 客户端和服务器端验证? - How to make RequiredIf Client-side and server-side validation in ASP.NET Core 3.1 MVC? ASP.NET双列表框使用JQuery更新了客户端,以及如何在服务器端检索结果 - ASP.NET dual listboxes updated client-side with JQuery, and how to retrieve the results server-side 用于客户端和服务器端验证的 ASP.NET Core 重用代码 - ASP.NET Core Reuse Code for Client-Side and Server-Side Validation 如何从客户端调用服务器端ASP.NET事件 - how to call a server-side ASP.NET event from the client-side ASP.NET:客户端验证,服务器端操作 - ASP.NET: Client-side validation, server-side action 如何在ASP.NET中从客户端调用服务器端函数? - How to call server-side function from client-side in ASP.NET? 客户端(jquery)和服务器端(asp.net)应用程序都可以访问的服务 - Service that can be accessed by both client-side (jquery) and server-side (asp.net) applications Asp.Net:在服务器端还原DropDownList的客户端SelectedItem - Asp.Net: Restoring client-side SelectedItem of DropDownList on server-side
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM