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. i want to shar som val

i want to shar som val

Scheduled Pinned Locked Moved ASP.NET
help
7 Posts 2 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.
  • A Offline
    A Offline
    Ahmed El Badry
    wrote on last edited by
    #1

    Public Shared vas As String the code shar val in all setion i want shar in one setion not all Plz help me

    Ahmed El-Badry

    G 1 Reply Last reply
    0
    • A Ahmed El Badry

      Public Shared vas As String the code shar val in all setion i want shar in one setion not all Plz help me

      Ahmed El-Badry

      G Offline
      G Offline
      Guffa
      wrote on last edited by
      #2

      What do you mean by section in this case? If you want the variable to be local to the object, just remove the Shared keyword.

      --- single minded; short sighted; long gone;

      A 1 Reply Last reply
      0
      • G Guffa

        What do you mean by section in this case? If you want the variable to be local to the object, just remove the Shared keyword.

        --- single minded; short sighted; long gone;

        A Offline
        A Offline
        Ahmed El Badry
        wrote on last edited by
        #3

        i want shar like cookes or send me a sample in cooke V thnx

        Ahmed El-Badry

        G 1 Reply Last reply
        0
        • A Ahmed El Badry

          i want shar like cookes or send me a sample in cooke V thnx

          Ahmed El-Badry

          G Offline
          G Offline
          Guffa
          wrote on last edited by
          #4

          Oh, so by "setion", you mean session, not section? If you remove the Shared keyword, the variable will be local to the object, and therefore also local to the thread. Each request that comes to the server is handled in a separate thread. If you want to keep the value from one request to another, on a user basis, you have to use session variables or cookies.

          --- single minded; short sighted; long gone;

          A 1 Reply Last reply
          0
          • G Guffa

            Oh, so by "setion", you mean session, not section? If you remove the Shared keyword, the variable will be local to the object, and therefore also local to the thread. Each request that comes to the server is handled in a separate thread. If you want to keep the value from one request to another, on a user basis, you have to use session variables or cookies.

            --- single minded; short sighted; long gone;

            A Offline
            A Offline
            Ahmed El Badry
            wrote on last edited by
            #5

            how use session variables give me a ex bad english sooooooooorye thnx u:rose:

            Ahmed El-Badry

            G 1 Reply Last reply
            0
            • A Ahmed El Badry

              how use session variables give me a ex bad english sooooooooorye thnx u:rose:

              Ahmed El-Badry

              G Offline
              G Offline
              Guffa
              wrote on last edited by
              #6

              You create a session variable by adding a value to the collection: Session["answer"] = 42; As session variables are of type object, you have to cast them to the correct type when you read them: int answer = (int)Session["answer"]; You can remove a variable from the collection: Session.Remove("answer"); You can also remove all variables: Session.RemoveAll();

              --- single minded; short sighted; long gone;

              A 1 Reply Last reply
              0
              • G Guffa

                You create a session variable by adding a value to the collection: Session["answer"] = 42; As session variables are of type object, you have to cast them to the correct type when you read them: int answer = (int)Session["answer"]; You can remove a variable from the collection: Session.Remove("answer"); You can also remove all variables: Session.RemoveAll();

                --- single minded; short sighted; long gone;

                A Offline
                A Offline
                Ahmed El Badry
                wrote on last edited by
                #7

                Thank you very much :-D:rose: to help me

                Ahmed El-Badry

                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