Click here to Skip to main content
15,902,737 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more: , +
Hi everyone,
in an .aspx page I have multiple update panels in each there's whether dropdownlist or a repeater.
Of course once there's an updatepanel a problem with browser back button.
I managed to re-set all the (cascading) dropdownlists when click back button, but binding the repeater with data I'm not able to do.

So My questions are:
1- the proper way to user Script manager AddHistoryPoint (using all history points in the last dropdownlist otherswise is not gonna work).
2-Add history point to a repeater and manage the scriptmanager Navigate.

Thanks in advance
Samira

What I have tried:

**Adding History point to the drop downlists //from trim dropdownlist:
C#
protected void DropDownListTrim_SelectedIndexChanged(object sender, EventArgs e)
        {
//some code
ScriptManager.GetCurrent(this.Page).AddHistoryPoint("yearid", DropDownListAnnee.SelectedItem.Value);
            ScriptManager.GetCurrent(this.Page).AddHistoryPoint("year", DropDownListAnnee.SelectedItem.Text);
            ScriptManager.GetCurrent(this.Page).AddHistoryPoint("modelid", DropDownListModele.SelectedItem.Value);
            ScriptManager.GetCurrent(this.Page).AddHistoryPoint("model", DropDownListModele.SelectedItem.Text);
            ScriptManager.GetCurrent(this.Page).AddHistoryPoint("trimid", DropDownListTrim.SelectedItem.Value);
            ScriptManager.GetCurrent(this.Page).AddHistoryPoint("trim", DropDownListTrim.SelectedItem.Text);
}

**set selected values of the dropdownlists (not sure if this is the correct way to do this)
C#
 protected void ScriptManager1_Navigate(object sender, HistoryEventArgs e)
        {
//it does set the selected values but for sure the dropdownlists don't have any other values!
//the dropdownlists are empty
DropDownListAnnee.SelectedValue = e.State["yearid"];
DropDownListAnnee.SelectedItem.Text = e.State["year"];
DropDownListModele.SelectedItem.Value = e.State["modelid"];
 DropDownListModele.SelectedItem.Text = e.State["model"];
DropDownListTrim.SelectedItem.Value = e.State["trimid"];
 DropDownListTrim.SelectedItem.Text = e.State["trim"];
}
Posted
Updated 26-Jul-16 5:48am
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900