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. How to Accss Session Variable in Javascript?

How to Accss Session Variable in Javascript?

Scheduled Pinned Locked Moved ASP.NET
javascripttutorialquestion
4 Posts 4 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
    Abubakarsb
    wrote on last edited by
    #1

    Hello, i want to set sesssion variable's value in Javascript function how is it possible? Anybody knows? Please inform me. Regards, AbuBakar

    M K R 3 Replies Last reply
    0
    • A Abubakarsb

      Hello, i want to set sesssion variable's value in Javascript function how is it possible? Anybody knows? Please inform me. Regards, AbuBakar

      M Offline
      M Offline
      minhpc_bk
      wrote on last edited by
      #2

      You cannot directly set the Session data with javascript, instead you may consider using AJAX and you can easily find lots of examples out there.

      1 Reply Last reply
      0
      • A Abubakarsb

        Hello, i want to set sesssion variable's value in Javascript function how is it possible? Anybody knows? Please inform me. Regards, AbuBakar

        K Offline
        K Offline
        ketankumar
        wrote on last edited by
        #3

        You can store in Cookie instead of session. You can set cookie value from javascript and also from asp.net code. Regards, Ketan.

        1 Reply Last reply
        0
        • A Abubakarsb

          Hello, i want to set sesssion variable's value in Javascript function how is it possible? Anybody knows? Please inform me. Regards, AbuBakar

          R Offline
          R Offline
          RichardGrimmer
          wrote on last edited by
          #4

          The best bet is to store it in a HiddenField control, then document.getElementById to retrieve it on the client side "Now I guess I'll sit back and watch people misinterpret what I just said......" Christian Graus At The Soapbox

          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