Small width layout Medium width layout Maximum width layout Small text Medium text Large text
     Search
Downloads Downloads Directory Directory Forums Forums Forge Forge Blogs Blogs        Marketplace Marketplace Careers Program Careers
Community › Forums Register  |  

AppTheory specializes in solutions based on the DotNetNuke platform and has 2 employees on the DotNetNuke Core Team.
  Need Help?  
Professional technical support for DotNetNuke is available from DotNetNuke Corporation.
 


  Ads  
The best choice for your web site host, email hosting, and domain registration.
 


  Sponsors  

Meet Our Sponsors

Red-Gate Software
MaximumASP
SourceGear - Tools for Developers
.: CounterSoft :.
telerik
ExactTarget email software solutions
 


DotNetNuke Forums
 
  Forum  General DotNetN...  Extend It! ( Pr...  Clear Cache within module event handler
Previous Previous
 
Next Next
New Post 9/30/2006 2:47 AM
User is offline C.N.
13 posts
10th Ranked


Clear Cache within module event handler 
How could I clear the cache in my module's event handler?  I know the core does this in one and only one place in the whole application: 
Taken from HostSettings.ascx.vb
        Public Sub cmdCache_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles cmdCache.Click

            ' clear entire cache
            DataCache.ClearHostCache(True)

            Response.Redirect(Request.RawUrl, True)

        End Sub

When I try to insert DataCache.ClearHostCache(True) in my module's update event handler, the error appears:
'ClearHostCache' is not a member of 'DotNetNuke.UI.Utilities.DataCache'. 
How can I call this function from within my module?  I tried to import all namespaces that were imported in HostSettings.ascs.vb but the error remains.  These include:
  • DotNetNuke.Common.Utilities.DataCache
  • DotNetNuke.UI.Utilities.DataCache
I need to clear the cache because I am dynamically altering tables in my database manually.  By doing so, the updates bypass the web application and will only be reflected once the cache is cleared.  I want to clear the cache from within the event handler to avoid having the user to do this through Host.Advanced Settings.Other Settings.Clear Cache.

Please Help!
Caley
 
New Post 9/30/2006 6:49 AM
User is offline Scott McCulloch
122 posts
9th Ranked






Re: Clear Cache within module event handler 
 cneeland wrote
How could I clear the cache in my module's event handler?  I know the core does this in one and only one place in the whole application: 
Taken from HostSettings.ascx.vb
        Public Sub cmdCache_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles cmdCache.Click

            ' clear entire cache
            DataCache.ClearHostCache(True)

            Response.Redirect(Request.RawUrl, True)

        End Sub

When I try to insert DataCache.ClearHostCache(True) in my module's update event handler, the error appears:
'ClearHostCache' is not a member of 'DotNetNuke.UI.Utilities.DataCache'. 
How can I call this function from within my module?  I tried to import all namespaces that were imported in HostSettings.ascs.vb but the error remains.  These include:
  • DotNetNuke.Common.Utilities.DataCache
  • DotNetNuke.UI.Utilities.DataCache

I need to clear the cache because I am dynamically altering tables in my database manually.  By doing so, the updates bypass the web application and will only be reflected once the cache is cleared.  I want to clear the cache from within the event handler to avoid having the user to do this through Host.Advanced Settings.Other Settings.Clear Cache.

Please Help!
Caley

Maybe it's getting confused, have you tried using the line like:-

  • DotNetNuke.Common.Utilities.DataCache.ClearHostCache(True)
  • This would make sure, you are using the correct class.


    Scott McCulloch, (Visit Ventrian Systems for access to modules such as "Simple Gallery", "News Articles", "Private Messages" and many more!)
     
    New Post 9/30/2006 6:57 AM
    User is offline C.N.
    13 posts
    10th Ranked


    Re: Clear Cache within module event handler 
    That did it!
    Thanks for the prompt reply
     
    New Post 9/30/2006 8:02 AM
    User is offline Scott McCulloch
    122 posts
    9th Ranked






    Re: Clear Cache within module event handler 

     cneeland wrote
    That did it!
    Thanks for the prompt reply

    Glad to hear it, clashing class names can sometimes be a problem, the best way to know exactly what class you are calling is to right click in visual studion on the name of the class and selecting "go to definition".


    Scott McCulloch, (Visit Ventrian Systems for access to modules such as "Simple Gallery", "News Articles", "Private Messages" and many more!)
     
    Previous Previous
     
    Next Next
      Forum  General DotNetN...  Extend It! ( Pr...  Clear Cache within module event handler
     


    Forum Policy

    These Discussion Forums are dedicated to the discussion of the DotNetNuke Web Application Framework.

    For the benefit of the community and to protect the integrity of the project, please observe the following posting guidelines:

    1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DotNetNuke.
    2. Discussion or promotion of DotNetNuke product releases under a different brand name are strictly prohibited.
    3. No Flaming or Trolling.
    4. No Profanity, Racism, or Prejudice.
    5. Site Moderators have the final word on approving/removing a thread or post or comment.
    6. English language posting only, please.

     


    OnyakTech
    Modules for Help Desks, Live Chat, Project Management, CRM, Charting, Reporting, Scrolling Text/Images, Portal Community tools and much more.
    www.OnyakTech.com
    IHostASP.NET Provides the Ideal DNN Hosting
    We will help you with the installation, configuration, and troubleshooting of your DNN portal, no task is too big or small for us. Unlike other companies we are not just providing a reliable hosting service, but we are also focused on providing the best DotNetNuke hosting service on the internet.
    www.ihostasp.net
    $7.16/mo - Powerful DotNetNuke Hosting
    Powerful DotNetNuke Hosting starting at under $8/mo with FREE SQL 2005, FREE Installation and expert support.
    www.re-invent.com

    DotNetNuke Corporation   Terms Of Use  Privacy Statement
    DotNetNuke®, DNN®, and the DotNetNuke logo are trademarks of DotNetNuke Corporation
    Hosted by MaximumASP