我得到SelectedValue = ""
当我点击我的按钮。
我的aspx:
<telerik:RadComboBox ID="ddl_contactList" runat="server" AutoPostBack="True" CausesValidation="False"
CollapseDelay="0" Culture="ar-EG" ExpandDelay="0" Filter="StartsWith" ItemsPerRequest="10"
MarkFirstMatch="true" Skin="Outlook" EnableAutomaticLoadOnDemand="True" EmptyMessage="-New Menu-"
ShowMoreResultsBox="True" OnSelectedIndexChanged="ddl_contactList_SelectedIndexChanged"
EnableItemCaching="false" EnableLoadOnDemand="True" EnableVirtualScrolling="True">
</telerik:RadComboBox>
我的.cs:
private void BindContactLists(int year, int main_code)
{
ddl_contactList.Items.Clear();
DataTable dt = ContactList.GetContactListsByDep(year, main_code);
ddl_contactList.DataSource = dt;
ddl_contactList.DataTextField = "list_desc";
ddl_contactList.DataValueField = "list_code";
ddl_contactList.DataBind();
}
我把它在page load
,因为当我把它在!Page.Ispostback
我得到以下错误:
没有指定数据源。 无法完成回调的要求。
我怎样才能解决这个问题呢? 马上:
ddl_contactList.Text == "MySelectedItemText"
但
selectedValue == ""
和selectedItem == ""