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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. Web Development
  3. ASP.NET
  4. cookies

cookies

Scheduled Pinned Locked Moved ASP.NET
3 Posts 3 Posters 1 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.
  • A Offline
    A Offline
    Aubyone
    wrote on last edited by
    #1

    I writing a number of pages that uses cookies to hold data that is writen and read through out all the pages, how can you have the same code call into all pages like the include *.inc in asp pages. Have try a class but can not write or read cookies.

    C J 2 Replies Last reply
    0
    • A Aubyone

      I writing a number of pages that uses cookies to hold data that is writen and read through out all the pages, how can you have the same code call into all pages like the include *.inc in asp pages. Have try a class but can not write or read cookies.

      C Offline
      C Offline
      Colin Angus Mackay
      wrote on last edited by
      #2

      Are you talking about ASP.NET or classic ASP? If you are doing this in ASP.NET 1.x then you need to make a class derived from System.Web.UI.Page that contains the common functionality. Then when you create your ASPX pages, you change the inheritance of the code behind to be your derived page class, so that all pages get this functionality. The functionality of the common page class that you are creating between ASP.NET and the code behind classes for the individual pages will include the code for processing the contents of your .inc files. To include an inc file into your page do something like:

      <!-- #include virtual="myCommonIncludeFile.inc" -->


      "If a man empties his purse into his head, no man can take it away from him, for an investment in knowledge pays the best interest." -- Joseph E. O'Donnell Not getting the response you want from a question asked in an online forum: How to Ask Questions the Smart Way!

      1 Reply Last reply
      0
      • A Aubyone

        I writing a number of pages that uses cookies to hold data that is writen and read through out all the pages, how can you have the same code call into all pages like the include *.inc in asp pages. Have try a class but can not write or read cookies.

        J Offline
        J Offline
        Jon Sagara
        wrote on last edited by
        #3

        Have you tried an ASP.NET UserControl[^]? It does the work of the old .inc files, and more.

        Jon Sagara You're a cross between a retarded person and a very smart man. -- My wife :-D
        My Articles

        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