I want to set DataTextField and DataValueField of a Dropdownlist (languageList) using a Dictionary (list) of languageCod
If the DropDownList is declared in your aspx page and not in the codebehind, you can do it like this.
.aspx:
.aspx.cs:
protected void Page_Load(object sender, EventArgs e)
{
ddlStatus.DataBind();
// or use Page.DataBind() to bind everything
}
public Dictionary Statuses
{
get
{
// do database/webservice lookup here to populate Dictionary
}
};