OutputCache problem

Last post 07-05-2009 3:28 AM by 3KyNoX. 2 replies.

Sort Posts:

  • OutputCache problem

    07-03-2009, 3:48 AM
    • Member
      12 point Member
    • 3KyNoX
    • Member since 06-29-2009, 6:16 AM
    • Montpellier, France
    • Posts 46

    Hello,


    on my asp website, i got a webform that displays a category products inside a gridview by selecting category on a dropdownlist.


    i activated outputcache on that page by adding to web.config :


    <sqlCacheDependency enabled="true" pollTime="500">
            <databases>
              <add name="dcNames" connectionStringName="csName" />
            </databases>
          </sqlCacheDependency>

    and on my administration.aspx page :

    <%@ OutputCache Duration="999999" VaryByParam="*" VaryByControl="DropDownList1" SqlDependency="dcName:Product;dcName:Category" %>

    to work with my two tables Products and Category.


    i got a label to verify the page generation at datetime.

    1st problem : When the website is launched, and when i change the dropdownlist selection, the label indicate correctly "Page generated at DateTime.Now" but content of the dropdownlist never updated untill the moment i do a F5 to refresh the page (when i modify a category name for example).

    Another problem is that when i select my administration.aspx page on the treeview contained in my masterpage, it keeps an old generation time and so my categories on the dropdownlist are not updated too and do not reflect the database.

    Any idea to correct that two problems please ?

    Each time someone let a stupid comment... http://tinyurl.com/m7nucg

    Every time u see an error message............ http://tinyurl.com/klkcbq
  • Re: OutputCache problem

    07-04-2009, 7:52 AM
    Answer
    • Star
      12,721 point Star
    • malcolms
    • Member since 06-12-2008, 4:38 AM
    • Melbourne, Australia
    • Posts 2,094

    Are you using SQL Server 2000 or SQL Server 2005?  If you're using 2005 then check out this article I wrote on it which explains how to clearly use it:

    http://www.dotnetcurry.com/ShowArticle.aspx?ID=263

    Sincerely,
    Malcolm Sheridan

    Microsoft Certified Solution Developer
    Please remember to click "Mark as Answer" on the post that helps you, and to click "Unmark as
    Answer" if a marked post does not actually answer your question.
  • Re: OutputCache problem

    07-05-2009, 3:28 AM
    • Member
      12 point Member
    • 3KyNoX
    • Member since 06-29-2009, 6:16 AM
    • Montpellier, France
    • Posts 46

    Thanks, taking time to read it.


    Using actually SQL Server 2008 SP1 express with advanced services (think it is the same way as 2005)

    Each time someone let a stupid comment... http://tinyurl.com/m7nucg

    Every time u see an error message............ http://tinyurl.com/klkcbq
Page 1 of 1 (3 items)