将其设置为不可见时未获取单选按钮的值 [英] Not getting value of radio button when setting it invisible

查看:68
本文介绍了将其设置为不可见时未获取单选按钮的值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好朋友,
我将单选按钮放置在gridview中并使它不可见.
我想要单击编辑按钮时单选按钮的值,然后将其发送到另一页.
问题是,当我保持单选按钮的可见性为true时,它为我提供了被选中还是未选中的值,但是当我将该属性设置为invisible时,它仅返回false(未选中)的值.

请帮助.

Hello Friends,
I am placing radio button in a gridview and keeping it invisible.
I want the value of radiobutton on clicking of edit button and send to it another page.
Problem when i keep the radio button visiility to true it gives me value whether it is checked or unchecked but when i set the property to invisible it only returns false(unchecked) value.

Kindly help.

推荐答案


尝试此操作而不是设置可见性:
Hi,
Try this instead of set off the visibility:
style="display:none"



希望对您有帮助
欢呼声



I hope it helps
Cheers


如果您将单选按钮设置为不可见,则意味着该单选按钮没有资源.您正在尝试获取不存在的值.肯定会返回一个空字符串.如果您打算不向用户显示单选按钮,请使用以下选项之一:

If you are setting the radio button invisible means there is no resource for that radio button. And you are trying to fetch the value which is not there.. Definitely it will return an empty string.. If you are planning to not show the radio button to the user use one of these:

RadioButton1.Attributes.Add("display", "none");





在源代码中:



or

in source :

style="display:none"



希望对您有所帮助.



I hope this will help you..


这篇关于将其设置为不可见时未获取单选按钮的值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆