allanmark
asked on
Refresh contents of User Control on MasterPage
Greetings all
I have a user control, on an Ajax PopUp control, on a MasterPage, providing an email facility (user clicks an icon and a form is displayed, etc). The user control reads a d/b table and populates a dropdown with names /email addresses (done on PageLoad)
When the user creates a new person, I would like their details to be added to the user control's dropdown list, ie, when the user clicks the "email" icon, and the "Email" form is popped up, the dropdoown will contain the recentl;y added address.
Where do I need to put the loading of the dropdown, in order for this to work?
In advance, thanks!!!
allanmark
I have a user control, on an Ajax PopUp control, on a MasterPage, providing an email facility (user clicks an icon and a form is displayed, etc). The user control reads a d/b table and populates a dropdown with names /email addresses (done on PageLoad)
When the user creates a new person, I would like their details to be added to the user control's dropdown list, ie, when the user clicks the "email" icon, and the "Email" form is popped up, the dropdoown will contain the recentl;y added address.
Where do I need to put the loading of the dropdown, in order for this to work?
In advance, thanks!!!
allanmark
ASKER
Like this?
protected override void OnPreRender(EventArgs e)
{
base.OnPreRender(e);
emailList = BusinessLogic.Business.Get EmailAddre ss();
Session["mailList"] = emailList;
ddlAddresses.DataSource = emailList;
ddlAddresses.DataTextField = "Name";
ddlAddresses.DataValueFiel d = "Email";
ddlAddresses.DataBind();
ddlAddresses.SelectedIndex = 0;
pnlMail.Enabled = ddlAddresses.Items.Count > 0;
}
protected override void OnPreRender(EventArgs e)
{
base.OnPreRender(e);
emailList = BusinessLogic.Business.Get
Session["mailList"] = emailList;
ddlAddresses.DataSource = emailList;
ddlAddresses.DataTextField
ddlAddresses.DataValueFiel
ddlAddresses.DataBind();
ddlAddresses.SelectedIndex
pnlMail.Enabled = ddlAddresses.Items.Count > 0;
}
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
your syntax will do as well...
ASKER
Many thanks!!
I hope I undesrtood your problem correctly!