Set Ajax Toolkit Accordion Panes all closed on load
Saturday 10 October 2009
As you know when you use the accordion element of the Ajax Toolkit, one of the panes is automatically open on load. Well there is a way around this, simply add the below to your page loading sub:
-
MyAccordion.selectedindex = "-1"
An example of this in place would be:
- Private Sub Page_Load()
- If Not Page.IsPostBack Then
- BindData()
- End If
- End Sub
-
- Private Sub BindData()
- MyAccordion.selectedindex = "-1"
- End Sub
You will also need to add the below code to your accordion:
-
requireopenedpane="false"
It should look something like this then:
- <cc1:accordion id="MyAccordion" runat="server"
- headercssclass="accordianheader" cssclass="accordian"
- contentcssclass="accordianitem" requireopenedpane="false" />
|
(8)
|
|
|