Now I am trying to use a button on the parent page to a usercontrol.
There is a checkboxlist on the usercontrol, and its datasource is read from database
the checkboxlist didn’t load correctly. it is like:
OnlineRenewa_draft1.tbl_LanguageChoices OnlineRenewa_draft1.tbl_LanguageChoices OnlineRenewa_draft1.tbl_LanguageChoices
OnlineRenewa_draft1.tbl_LanguageChoices OnlineRenewa_draft1.tbl_LanguageChoices OnlineRenewa_draft1.tbl_LanguageChoices
is it about postback issue?
Any idea?
thanks
protected void Page_Load(object sender, EventArgs e)
{
//if (!IsPostBack) {
List<tbl_LanguageChoices> LanguageList = ((List<tbl_LanguageChoices>)Cache["LanguageChoise"]);
otherlanguage.DataSource = LanguageList;
otherlanguage.DataBind();
otherlanguage.DataTextField = "Languages";
otherlanguage.DataValueField = "GUID";
}
You’re first databinding the checkboxlist’s to the
DataSourceand then settingDateValueFieldandDataValueField.DataBindshould be the last step.