如何在中继器中选择radiobutton id? [英] How get selected radiobutton id in repeater?

查看:54
本文介绍了如何在中继器中选择radiobutton id?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,



我有一个转发器控件,其中包含一个标签和四个单选按钮,



我有一个中继器的按钮底部,



点击按钮然后我需要所有选中的单选按钮ID或值



我该怎么做?



非常非常感谢。

解决方案

尝试此代码..

  string  rdValues =  ; 
foreach (RepeaterItem ri in RepDetails.Items)
{
RadioButton rd =(RadioButton)ri.FindControl( rdioId1);

if (rd.Checked == true
{
rdValues = rdValues + rd.Text;
}
}



还检查以下链接答案1

http://stackoverflow.com/questions/10880297/find-control-in-asprepeater-on-button-click-event [ ^ ]


Hello,

I have a repeater control which contains a one label and four radio buttons,

I have a button bottom of the repeater,

when click on button then I need to all selected radio button id or value

how can I do this?

Very very Thanks.

解决方案

try this code..

string rdValues="";
foreach (RepeaterItem ri in RepDetails.Items)
        {
           RadioButton rd = (RadioButton)ri.FindControl("rdioId1");

            if (rd.Checked == true)
        {
            rdValues=rdValues+rd.Text;
        }
    }


also check following link Answer 1
http://stackoverflow.com/questions/10880297/find-control-in-asprepeater-on-button-click-event[^]


这篇关于如何在中继器中选择radiobutton id?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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