我用HtmlTable 动态添加了DropDownList控件,请问怎样才能创建它的SelectedIndexChanged事件
ww012 2006-01-18 08:21:43 还有怎样取得DropDownList的当前所选择的值
部分代码:
HtmlTableRow BenefitItemRow;
HtmlTableCell BenefitItemCell;
string html1= "<tr><td class="+"'table_item'"+"align="+"'right'"+"></td><td class="+"'table_value'"+">";
for(int i=AddItemNum*5+1;i<=(AddItemNum+1)*5;i++)
{
BenefitItemRow = new HtmlTableRow();
BenefitItemCell = new HtmlTableCell();
string strBenefitItemName = string.Format("ddlInterestedBenefitItem{0}",i);
string strBenefitItemNameEventName = strBenefitItemName+"_SelectedIndexChanged";
string strtxtAmount =string.Format("txtAmount{0}",i);
string strrevtxtAmount =string.Format("revtxtAmount{0}",i);
string htmlValidation="^(-?\\d{1,8})(\\.\\d{2})?$";
BenefitItemCell.InnerHtml = html1;
#region Bound DropDownList
DropDownList BenefitItem=new DropDownList();
BenefitItem.ID=strBenefitItemName;
BenefitItemCell.Controls.Add(BenefitItem);
..........