Hi
I have a website that uses master pages. On the master page I have a sidebar div containing an Ajax accordion control that provides site navigation. When the user clicks a link from the accordion, I pass the index of the pane on the query string. Each webform inherits from a single base class. In the Page_Load event of the base class I check the query string for the active pane index and then set the Accordion.SelectedIndex property. This prevents the accordion control from resetting to pane 0 each time the user navigated to a different page.
The above works fine when navigating directly from the Accordion control. My problem is that it's also possible for the user to Navigate from a webform - they can click the 'Edit' hyperlink of a GridView which takes them to a page containing a DetailsView of the selected record. In this case I need to determine the index of "current" accordion pane so that I can set this on the page load event of the webform containing the details view.
I am able to trap the event of the accordion being selected with the following javascript:
function pageLoad() {
var accordion = $find('<%= Accordion1.ClientID %>' + '_AccordionExtender');
accordion.add_selectedIndexChanged(onACESelectedIndexChanged);
}
function onACESelectedIndexChanged(sender, eventArgs) {
//alert(sender.get_SelectedIndex());
}
I need to store the "SelectedIndex" somewhere so that it can be read by the page_load event of the webform containing the details view.
Do I need to use cookies for this?
Thanks
Rob.