I have a DropDownList I must have to refresh all site page to add a element to them from propeties in Event Receiver AddingItem.
How Can I refresh the page locally or maybe with in a Update Panel?
I inserted a Update panel, but it is doesn't work, and only refresh page help to update DropDownList by new element:
The code of DropDownList adding:
protected void Page_Load(object sender, EventArgs e)
{
SPWeb witryna = SPContext.Current.Web;
SPListItemCollection listaDniNaProjektDropDownList = witryna.Lists["Szczegoly"].Items;
int index;
// Początek IsPostBack
if (!IsPostBack)
{
DropDownList1.Items.Add("<-- Wszystcy pracownicy -->");
foreach (SPListItem oListaDniUrlopu in listaDniNaProjektDropDownList)
{
// Dodawanie do DropDownList1 kolejnych obiektów listy
index = oListaDniUrlopu["Pracownik"].ToString().IndexOf("#");
DropDownList1.Items.Add((oListaDniUrlopu["Pracownik"].ToString().Substring(index + 1)));
}