All pastes #146814 Raw Edit

Someone

public text v1 · immutable
#146814 ·published 2006-08-23 22:04 UTC
rendered paste body
// this is how i load the DropDownList:
this.ddlDescriptions.Items.Clear();
this.ddlDescriptions.DataSource = dtDescritions;
this.ddlDescriptions.DataTextField = "DescriptionText";
this.ddlDescriptions.DataValueField = "DescriptionPkey";
this.ddlDescriptions.DataBind();
this.ddlDescriptions.Items.RemoveAt(0);


// this is how i try to get a reference of the currently selected item in the DDL:
protected void btnDelete_Click(object sender, EventArgs e)
    {
        string descriptionId = this.ddlDescriptions.SelectedValue;
        string sss = this.ddlDescriptions.SelectedItem.Text;
        int index = this.ddlDescriptions.SelectedIndex;
        ListItem li = this.ddlDescriptions.SelectedItem;
    }