簡體   English   中英

從以編程方式創建的RadioButtonList中獲取選定的值

[英]Get the selected value from a programatically created RadioButtonList

在我的ASP.NET項目中,我需要為動態大小表的每一列創建一個RadioButtonList。 該表格的尺寸是通過Web服務設置的。 對於這種情況,我在循環中創建了一個RadioButtonList

for (int j = 0; j < columns; j++)
{
    //Create a RadioButtonList for each column/////////
      RadioButtonList rbl = new RadioButtonList();
      rbl.ID = "rbl" + j.ToString();
      rbl.RepeatDirection = RepeatDirection.Vertical;

代碼按預期工作,但是為了進行進一步處理,我需要從循環外部獲取RadioButtonList內的選定RadioButton的ID。 我該怎么做?

親切的問候

簡單的方法是通過Global創建一個RadioButtonList並在循環內添加Radiobutton,然后可以在循環外獲取選定的值

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM