locked
When switching between TabPanels the page appears to load twice. RRS feed

  • Question

  • User1453632690 posted

    I have a TabContainer on a page with 4 TabPanels. A couple of the TabPanels contain UpdatePanels. I also have a handler for the activeTabChanged event. This handler checks the HeaderText of the active tab, and if it matches a target string, I call a method to reset the controls on that TabPanel. I only do this for 1 of the TabPanels, but the Page double load happens no matter which TabPanel I click on.

    Any help would be greatly appreciated.

    Wednesday, December 23, 2015 10:53 PM

Answers

  • User1453632690 posted

    Actually, I won't need to do that. Immediately after I wrote the last comment I started looking at the .aspx code to get an idea of what I would need to do to post a working page and code. The first thing that caught my eye was that I had "AutoPostBack=true" on the TabContainer. I changed it to false and reran the app; no more double load! Problem solved I guess. 

    The moral of the story is "Don't change default values unless really necessary!"

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, December 24, 2015 3:32 AM

All replies

  • User61956409 posted

    Hi jnickFL1,

    the Page double load happens no matter which TabPanel I click on.

    Firstly, please set a breakpoint in page load event, then you could debug your code to check whether it will hit the breakpoint twice when you change tab.

    Secondly, could you share us your relevant code? We will reproduce your problem based on your code.

    Best Regards,

    Fei Han

    Thursday, December 24, 2015 2:32 AM
  • User1453632690 posted

    I'll have to breakout the page code and the code behind without references, etc. I'll post both, in a simplified form, in the AM.

    As far as the Page Load event goes, the handler is entered upon first loading the Page, as expected, as well as on each TabPanel change. I think the visual phenomenon must have something to do with the UpdatePanels I have in the TabPanels. We'll see tomorrow!

    Thanks

    Thursday, December 24, 2015 3:27 AM
  • User1453632690 posted

    Actually, I won't need to do that. Immediately after I wrote the last comment I started looking at the .aspx code to get an idea of what I would need to do to post a working page and code. The first thing that caught my eye was that I had "AutoPostBack=true" on the TabContainer. I changed it to false and reran the app; no more double load! Problem solved I guess. 

    The moral of the story is "Don't change default values unless really necessary!"

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, December 24, 2015 3:32 AM