There is a drop down list on the web user control (.ascx). I am binding the DropDown list control on aspx code behind page. I have tried binding it in Load , PreLoad events but its just empty after postback. I have tried the enable view state option but no luck.
I have a method in web user control for binding dropdown list and i am calling it from the main aspx code which is using this web user control .
.ascx
public void FillDropDownList(string divisionCode, Int32 webEvevntID)
{
DataSet dsDist = GetData(divisionCode, webEvevntID);
ddlDist.DataSource = dsDist.Tables(0);
ddlDist.DataTextField = "DistributorName";
ddlDist.DataValueField = "DistNum";
ddlDist.DataBind();
}
.aspx c#
private void Order_PreRender(object sender, EventArgs e)
{
FillDropDownList();
}
Do this in pageload of user control