-1

我有 ddlModalityList 下拉列表.. 选择 ddlModalityList.. 我必须在另一个下拉列表中填充相应的选定研究。

    protected void Page_Load(object sender, EventArgs e)
        {
        var dictionery = new Dictionary<int, string>();

                foreach (DataRow dr in dataTableAcqModality.Rows)


 {
                ModalityID = Convert.ToInt32(dr["Modality_ID"]);
                strModality = dr["Modality"].ToString();
                strSchStaAETitle = dr["Scheduled_Station_AE_Title"].ToString();
                strSchStaName = dr["SCHEDULED_STATION_NAME"].ToString();
                strDdlModality = strModality + "(" + strSchStaAETitle + "|" + strSchStaName + ")";

                dictionery.Add(ModalityID, strDdlModality);
            }

            ddlModalityList.DataTextField = "Value";
            ddlModalityList.DataValueField = "Key";
            ddlModalityList.DataSource = dictionery;
            ddlModalityList.DataBind();
}

    protected void ddlModalityList_SelectedIndexChanged(object sender, EventArgs e)
        { 
             Dictionary<int, string> selectedPair = (Dictionary<int,string>)ddlModalityList.SelectedItem;
} 
    }
4

1 回答 1

0
protected void ddlModalityList_SelectedIndexChanged(object sender, EventArgs e)
        {     
             ListItem selectedPair = ddlModalityList.SelectedItem;
        }
于 2012-05-02T10:17:35.230 回答