使用 foreach 获取中继器数据 [英] Get Repeater data with foreach
本文介绍了使用 foreach 获取中继器数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我的页面中有一个中继器,在数据绑定后,我必须单击一个按钮在页面中回发,并且我需要在来自我的中继器的所有数据中执行 foreach
.实际上,我必须在 foreach
语句中获取每个项目作为示例.
I have a Repeater in my page and after databinding, I have to click on a button to postback in page, and I need to do a foreach
in all data from my Repeater.
In true I have to get each item inside foreach
statment as example.
foreach (RepeaterItem itemEquipment in rptSpecialEquipments.Items)
{
// Get Data From My Repeater
}
此致,
米尔顿·卡马拉·戈麦斯
Milton Câmara Gomes
推荐答案
这是您想要的吗?
foreach (RepeaterItem itemEquipment in rptSpecialEquipments.Items)
{
//to get the dropdown of each line
DropDownList yourDropDown = (DropDownList)item.FindControl("the name of your dropdown control here");
//to get the selected value of your dropdownlist
string value = yourDropDown.SelectedValue;
}
这篇关于使用 foreach 获取中继器数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文