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 immediately change value of session variable?

how to immediately change value of session variable?

Scheduled Pinned Locked Moved ASP.NET
tutorialquestion
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.
  • M Offline
    M Offline
    Mehdi Bahrami
    wrote on last edited by
    #1

    I have a webform page, this page have a button for change session variable, when user click on this button session variable don't show new value after page postback action, and if user click again on this button or refresh value of session variable change then for this user must be click on this button minimum 2 times. how to immediately change value of session variable? (I don't want to use querystring and refresh)

    Mehdi Bahrami

    A 1 Reply Last reply
    0
    • M Mehdi Bahrami

      I have a webform page, this page have a button for change session variable, when user click on this button session variable don't show new value after page postback action, and if user click again on this button or refresh value of session variable change then for this user must be click on this button minimum 2 times. how to immediately change value of session variable? (I don't want to use querystring and refresh)

      Mehdi Bahrami

      A Offline
      A Offline
      Abhijit Jana
      wrote on last edited by
      #2

      Mehdi Bahrami wrote:

      how to immediately change value of session variable? (I don't want to use querystring and refresh)

      What do you mean by that? You want to change session variable on button click ? You just need to update the session variable. Better you post the code and ask your query.

      cheers, Abhijit CodeProject MVP

      M 1 Reply Last reply
      0
      • A Abhijit Jana

        Mehdi Bahrami wrote:

        how to immediately change value of session variable? (I don't want to use querystring and refresh)

        What do you mean by that? You want to change session variable on button click ? You just need to update the session variable. Better you post the code and ask your query.

        cheers, Abhijit CodeProject MVP

        M Offline
        M Offline
        Mehdi Bahrami
        wrote on last edited by
        #3

        when user click on imagebutton8 show true and after click on imagebutton8 again show true but I want show False. Protected Sub Page_PreLoad(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.PreLoad If Page.IsPostBack Then Response.Write(Session("null")) End Sub Protected Sub ImageButton9_Click(ByVal sender As Object, ByVal e As System.Web.UI.ImageClickEventArgs) Handles ImageButton9.Click Session.Contents("null") = False End Sub Protected Sub ImageButton8_Click(ByVal sender As Object, ByVal e As System.Web.UI.ImageClickEventArgs) Handles ImageButton8.Click Session.Contents("null") = True End Sub Thank You

        Mehdi Bahrami

        Y 1 Reply Last reply
        0
        • M Mehdi Bahrami

          when user click on imagebutton8 show true and after click on imagebutton8 again show true but I want show False. Protected Sub Page_PreLoad(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.PreLoad If Page.IsPostBack Then Response.Write(Session("null")) End Sub Protected Sub ImageButton9_Click(ByVal sender As Object, ByVal e As System.Web.UI.ImageClickEventArgs) Handles ImageButton9.Click Session.Contents("null") = False End Sub Protected Sub ImageButton8_Click(ByVal sender As Object, ByVal e As System.Web.UI.ImageClickEventArgs) Handles ImageButton8.Click Session.Contents("null") = True End Sub Thank You

          Mehdi Bahrami

          Y Offline
          Y Offline
          Yusuf
          wrote on last edited by
          #4

          Mehdi Bahrami wrote:

          Session.Contents("null") = False

          Mehdi Bahrami wrote:

          Session.Contents("null") = True

          Seesion("null") = True Session("null") = False I don't think "null" is good name. I would do Session("ShowImage") = True Session("ShowImage") = False

          Yusuf Oh didn't you notice, analogous to square roots, they recently introduced rectangular, circular, and diamond roots to determine the size of the corresponding shapes when given the area. Luc Pattyn[^]

          M 1 Reply Last reply
          0
          • Y Yusuf

            Mehdi Bahrami wrote:

            Session.Contents("null") = False

            Mehdi Bahrami wrote:

            Session.Contents("null") = True

            Seesion("null") = True Session("null") = False I don't think "null" is good name. I would do Session("ShowImage") = True Session("ShowImage") = False

            Yusuf Oh didn't you notice, analogous to square roots, they recently introduced rectangular, circular, and diamond roots to determine the size of the corresponding shapes when given the area. Luc Pattyn[^]

            M Offline
            M Offline
            Mehdi Bahrami
            wrote on last edited by
            #5

            But my problem not for name. I use every name but this problem occure again.

            Mehdi Bahrami

            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