CollapsiblePanelExtender to hide old news in my homepage. The problem is that all the data in the CollapsiblePanelExtender is loaded in Page_Load. This results in that the page takes a long
time to load. How can I prevent the data from beeing loaded in Page_Load and load the data when the panel is extended?
In my particular case, I only show one section by default, then the user has the option to either open the other section, and/or close the first section, so it is not too important...
Someone with more knowledge can better answer that question... [8-|]
Този уебсайт е твърде бавен. Мисля, че IIS 7 не е конфигуриран правилно. Моля, премахнете банери по-горе.
oysts
0 Points
1 Post
Get data when expanded
Mar 18, 2007 06:47 AM|LINK
Hi!
I'm using the
CollapsiblePanelExtender to hide old news in my homepage. The problem is that all the data in the CollapsiblePanelExtender is loaded in Page_Load. This results in that the page takes a long time to load. How can I prevent the data from beeing loaded in Page_Load and load the data when the panel is extended?Best regards
Øystein
ksasp
Member
33 Points
41 Posts
Re: Get data when expanded
Mar 18, 2007 04:24 PM|LINK
Not sure if this is your exact case, but here is what I did in a similar situation...
Add a ScriptManager.
Put a View and MultiView inside of an UpdatePanel.
Set the 'UpdateMode of the UpdatePanel to 'Conditional'.
Put all of your content inside of the View.
Now what I did was make my own little '+' and '-' images, to expand/collapse the MultiViews.....
I added a Label with text. Not important here...
Double click the images, and it creates skeletons for 'Clicks'......and in my case, I added this:
ImageButton1 is the '-' and ImageButton2 is the '+'....
Set the '-' Visible property to False, and the '+' Visible property to True.
protected void ImageButton1_Click(object sender, ImageClickEventArgs e)
{
MultiView1.ActiveViewIndex = -1;
Label1.Text = "Expand Departure";
ImageButton1.Visible = false;
ImageButton2.Visible = true;
}
protected void ImageButton2_Click(object sender, ImageClickEventArgs e)
{
MultiView1.ActiveViewIndex = 0;
Label1.Text = "Collapse Departure";
ImageButton2.Visible = false;
ImageButton1.Visible = true;
}
Hope this helps...[Yes]
josdavis
Member
2 Points
1 Post
Re: Get data when expanded
Apr 04, 2007 05:16 PM|LINK
ksasp
Member
33 Points
41 Posts
Re: Get data when expanded
Apr 05, 2007 06:06 PM|LINK
I honestly don't know. It appears that way...
In my particular case, I only show one section by default, then the user has the option to either open the other section, and/or close the first section, so it is not too important...
Someone with more knowledge can better answer that question... [8-|]