locked
SPWeb disposed after many postbacks RRS feed

  • Question

  • Hi, I have an issue with a custom aspx page. I have added an asp:Calendar which works fine, but after many postbacks (p.ex. if you try to change to a distant month) my SPWeb is been disposed.

     

    Any suggestions?

    Wednesday, March 24, 2010 3:03 PM

Answers

  • It seems that you keep the SPWeb object long enough to let it timed out.

    Two solutions:

    1. Minimize the time you keep the SPWeb object

    2. Reference each SPWeb object during each postback.


    Cogito, ergo sum.
    • Marked as answer by iliastsouk Tuesday, March 30, 2010 5:38 AM
    Friday, March 26, 2010 2:23 AM

All replies

  • What do you means for asp:calendar ? it's the calendar control of asp.net, isn't it?
    In that case there is no OOB correlation between calendar control and sharepoint. Did you write any code to bind the control ?


    --marco @avanade
    Wednesday, March 24, 2010 3:45 PM
  • Without knowing your code it will quite difficult. Please try to reduce your code as long as the problem can be reproduced.

     

    Did you already try this tool from MS

     

    http://code.msdn.microsoft.com/SPDisposeCheck

     

    if you should open a SPWeb that is leaking you should most probably be able to find it with this tool.

     

    regards,

    Markus

    Wednesday, March 24, 2010 3:47 PM
  • It seems that you keep the SPWeb object long enough to let it timed out.

    Two solutions:

    1. Minimize the time you keep the SPWeb object

    2. Reference each SPWeb object during each postback.


    Cogito, ergo sum.
    • Marked as answer by iliastsouk Tuesday, March 30, 2010 5:38 AM
    Friday, March 26, 2010 2:23 AM