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. General Programming
  3. C#
  4. "Public Shared" equivalent in VB & Global

"Public Shared" equivalent in VB & Global

Scheduled Pinned Locked Moved C#
sysadminxmlquestiondiscussion
3 Posts 1 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.
  • S Offline
    S Offline
    Sled Dog
    wrote on last edited by
    #1

    I have a set of XML files that I parse & put into a dropdown list. I don't want to read this set of files off the network every time the page loads. I was considering establishing a data set in the GLOBAL.ASAX file in the Session section. I would just bind that dataset on the page load for this one dropdown where it occurs in the application. NOW, I know I will hear some "purist" objections to using anything that sounds like a global variable, but it seems far more efficient than reading 100+ XML files every time the page loads for every user. I have tried creating a dataset in the Session_Start, but it isn't clear how I would access it. Any thoughts? Also, I am curios if there is an equivalent to a variable declared on a page in VB "Public Shared MyInt As Integer"? Thanks. SD

    S 2 Replies Last reply
    0
    • S Sled Dog

      I have a set of XML files that I parse & put into a dropdown list. I don't want to read this set of files off the network every time the page loads. I was considering establishing a data set in the GLOBAL.ASAX file in the Session section. I would just bind that dataset on the page load for this one dropdown where it occurs in the application. NOW, I know I will hear some "purist" objections to using anything that sounds like a global variable, but it seems far more efficient than reading 100+ XML files every time the page loads for every user. I have tried creating a dataset in the Session_Start, but it isn't clear how I would access it. Any thoughts? Also, I am curios if there is an equivalent to a variable declared on a page in VB "Public Shared MyInt As Integer"? Thanks. SD

      S Offline
      S Offline
      Sled Dog
      wrote on last edited by
      #2

      I found the answer to my tranlation question. There is a nice site that does translations back and forth between VB & C#: http://www.carlosag.net/Tools/CodeTranslator/Default.aspx; however, I would still be interested in any response to my GLOBAL question. Thanks again, Sd

      1 Reply Last reply
      0
      • S Sled Dog

        I have a set of XML files that I parse & put into a dropdown list. I don't want to read this set of files off the network every time the page loads. I was considering establishing a data set in the GLOBAL.ASAX file in the Session section. I would just bind that dataset on the page load for this one dropdown where it occurs in the application. NOW, I know I will hear some "purist" objections to using anything that sounds like a global variable, but it seems far more efficient than reading 100+ XML files every time the page loads for every user. I have tried creating a dataset in the Session_Start, but it isn't clear how I would access it. Any thoughts? Also, I am curios if there is an equivalent to a variable declared on a page in VB "Public Shared MyInt As Integer"? Thanks. SD

        S Offline
        S Offline
        Sled Dog
        wrote on last edited by
        #3

        Forget it. This was a bad question. I simply put a public dataset on the page of interest and read the XML into the dataset on if (!PostBack). Thanks anyway. Sd

        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