获取多个动态单选按钮列表的文本 [英] get the text of multiple dynamic radiobuttonlists

查看:68
本文介绍了获取多个动态单选按钮列表的文本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经显示了多个动态单选按钮列表控件,它们等于表中的记录数,我在每个单选按钮列表控件中添加了两个项目,例如P和A,并且还在Web表单中添加了静态按钮控件. br/>
现在,我要........当我单击按钮时,必须在数据库的表中更新每个单选按钮列表中的选定文本,并在表中更新其各自的ID.请尽快帮助我

Hi, i have displayed multiple dynamic radiobuttonlist controls equal to the no of records in the table, i have added two items like P and A in each radiobutton list control, and i added static button control also in the web form.

Now i want........ when i click the button, selected text in the each radiobutton list, must be updated in the table in database with their respective id in the table. please help me as soon as possible

推荐答案

string selectedTexts = String.Empty;
            foreach (ListItem itm in rdList.Items)
            {
                selectedTexts += itm.Selected == true ? "," + itm.Text : String.Empty;
            }
            selectedTexts = selectedTexts.Length > 0 ? selectedTexts.Substring(1) : String.Empty;


这篇关于获取多个动态单选按钮列表的文本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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