Greetings,
1) I assume ObjectDataSource automatically binds to data source only on first request, but not on postbacks ( else ObjectDataSource.Selecting event would be fired on postbacks also, but it isn’t):
A) So only way to force ObjectDataSource to also bind on postbacks is by manually calling DataBind()?
2) Assuming DropDownList1 has DataSourceID set to ObjectDataSource1 , then first time page is loaded, ObjectDataSource1 will automatically call DropDownList1.DataBind() ( after Page.PreRender event) and insert retrieved data.
A) But what if we also manually call DropDownList1.DataBind() when page is first loaded:
protected void Page_Load(object sender, EventArgs e)
{
if(!IsPostBack) DropDownList1.DataBind();
}
Will ObjectDataSource1 somehow notice that DropDownList1.DataBind() has already be called and thus won’t automatically call DropDownList1.DataBind() ?
B) Normally ObjectDataSource1.Selecting event is fired after Page.Prerender event.But what if DropDownList1.DataBind() is called inside *Page_Load()*?
Will in that case ObjectDataSource1.Selecting event be fired prior to Page.PreRender?
thanx