Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeArchived Discus...Archived Discus...Developing Under Previous Versions of .NETDeveloping Under Previous Versions of .NETASP.Net 2.0ASP.Net 2.0Clear Cache within module event handlerClear Cache within module event handler
Previous
 
Next
New Post
9/30/2006 5:47 AM
 
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 9:49 AM
 
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
    Developer, F5 Networks
    Owner, Ventrian DotNetNuke Modules
     
    New Post
    9/30/2006 9:57 AM
     
    That did it!
    Thanks for the prompt reply
     
    New Post
    9/30/2006 11:02 AM
     

    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
    Developer, F5 Networks
    Owner, Ventrian DotNetNuke Modules
     
    Previous
     
    Next
    HomeHomeArchived Discus...Archived Discus...Developing Under Previous Versions of .NETDeveloping Under Previous Versions of .NETASP.Net 2.0ASP.Net 2.0Clear Cache within module event handlerClear Cache within module event handler


    These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

    For the benefit of the community and to protect the integrity of the ecosystem, 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 DNN.
    2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
    3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
    4. No Flaming or Trolling.
    5. No Profanity, Racism, or Prejudice.
    6. Site Moderators have the final word on approving / removing a thread or post or comment.
    7. English language posting only, please.
    What is Liquid Content?
    Find Out
    What is Liquid Content?
    Find Out
    What is Liquid Content?
    Find Out