简体   繁体   English

如何在aspx.cs文件中使用动态单选按钮

[英]How to use Dynamic Radio button in aspx.cs file

我已经从Java脚本创建了DYNAMIC单选按钮列表,现在我想在aspx.cs页面中使用此单选按钮列表,我该怎么办?

The server-side code will be unaware of a control dynamically created in JavaScript on the client-side. 服务器端代码将不知道在客户端JavaScript中动态创建的控件。 Likewise, the viewstate of the control will be invalidated if you create options in the list that aren't available at runtime. 同样,如果您在列表中创建在运行时不可用的选项,则控件的viewstate将无效。

In order to access the values in the code behind, you'll need to pass the values either with AJAX or set a hidden field value prior to postback. 为了访问后面代码中的值,您需要在回发之前使用AJAX传递值或设置隐藏字段值。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM