Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. disallow page level cache

disallow page level cache

Scheduled Pinned Locked Moved ASP.NET
csharpasp-nettutorial
5 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • P Offline
    P Offline
    P S Pundeer
    wrote on last edited by
    #1

    Hi there I am in urgent need to know how to disable page level caching in a user control. Please provide asp.net 2.0 specific solution.

    D 1 Reply Last reply
    0
    • P P S Pundeer

      Hi there I am in urgent need to know how to disable page level caching in a user control. Please provide asp.net 2.0 specific solution.

      D Offline
      D Offline
      Deepak the Cool
      wrote on last edited by
      #2

      these code may help u to remove page from cache. these code r write into Page Load event if (Session["username"] == null) { Response.Redirect("login.aspx"); } Response.Buffer = true; Response.ExpiresAbsolute = DateTime.Now.AddDays(-1d); Response.Expires = -1500; Response.CacheControl = "no-cache"; :)

      Deepak Smile a Lots,Its Costs Nothing

      P 1 Reply Last reply
      0
      • D Deepak the Cool

        these code may help u to remove page from cache. these code r write into Page Load event if (Session["username"] == null) { Response.Redirect("login.aspx"); } Response.Buffer = true; Response.ExpiresAbsolute = DateTime.Now.AddDays(-1d); Response.Expires = -1500; Response.CacheControl = "no-cache"; :)

        Deepak Smile a Lots,Its Costs Nothing

        P Offline
        P Offline
        P S Pundeer
        wrote on last edited by
        #3

        Thanx Deepak But I was looking for page directive to disable caching.

        L 1 Reply Last reply
        0
        • P P S Pundeer

          Thanx Deepak But I was looking for page directive to disable caching.

          L Offline
          L Offline
          l0kke
          wrote on last edited by
          #4

          Page.Response.Cache.SetCacheability(HttpCacheability.NoCache) ? you should explain what behaviour you would like to achieve... Pilo

          P 1 Reply Last reply
          0
          • L l0kke

            Page.Response.Cache.SetCacheability(HttpCacheability.NoCache) ? you should explain what behaviour you would like to achieve... Pilo

            P Offline
            P Offline
            P S Pundeer
            wrote on last edited by
            #5

            Thanx for that

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups