简体   繁体   English

如何在客户端访问GridView的DataKey单元?

[英]How can I reach DataKey cells of GridView on the client-side?

I need to reach DataKey columns of a GridView on the client side by a JavaScript function. 我需要通过JavaScript函数在客户端上访问GridView的DataKey列。

As they they are at least visually disabled on the UI I wonder if I can still reach them on client? 由于它们至少在UI上处于视觉上禁用状态,我想知道是否仍可以在客户端上访问它们?

Is it possible? 可能吗?

DataKeys are not published to the client. 数据密钥不会发布到客户端。 You have to write out the values some way, either use a hidden field in a template column (but don't set the column to visible="false") or some other means to get this to work. 您必须以某种方式写出值,或者在模板列中使用隐藏字段(但不要将列设置为visible =“ false”),或者通过其他方式使其生效。

I'm sure there are other ways too... 我敢肯定还有其他方法...

HTH. HTH。

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

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