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. Session lose value

Session lose value

Scheduled Pinned Locked Moved ASP.NET
help
5 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.
  • N Offline
    N Offline
    Nagraj Naik
    wrote on last edited by
    #1

    Hi all, I am using linkbutton in datagrid and ONCOMMAND event I collect row ID. This Id I am saving in Session("ID").I displayed this session("ID") by messagebox on same page.Everything goes fine,but when I redirect to another page and try to use session("ID") it gives nothing. Sub Navigation(ByVal sender As Object, ByVal e As CommandEventArgs) Session("ID") = e.CommandArgument MsgBox(Session("ID")) Response.Redirect("ResumeSearchDetails.aspx") End Sub ///ResumeSearchDetails.aspx Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load If Not Page.IsPostBack Then MsgBox(Session("ID")) end if end sub MsgBox(Session.SessionID) gives some value on both page which is not same that means total session is not expired only value lose. I hope you understand my problem. Thanks. Teach Life To Laugh.......

    S 1 Reply Last reply
    0
    • N Nagraj Naik

      Hi all, I am using linkbutton in datagrid and ONCOMMAND event I collect row ID. This Id I am saving in Session("ID").I displayed this session("ID") by messagebox on same page.Everything goes fine,but when I redirect to another page and try to use session("ID") it gives nothing. Sub Navigation(ByVal sender As Object, ByVal e As CommandEventArgs) Session("ID") = e.CommandArgument MsgBox(Session("ID")) Response.Redirect("ResumeSearchDetails.aspx") End Sub ///ResumeSearchDetails.aspx Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load If Not Page.IsPostBack Then MsgBox(Session("ID")) end if end sub MsgBox(Session.SessionID) gives some value on both page which is not same that means total session is not expired only value lose. I hope you understand my problem. Thanks. Teach Life To Laugh.......

      S Offline
      S Offline
      Suamal
      wrote on last edited by
      #2

      In global.asax on Session_onStart initialize as Session("ID")=null and find whether there is any other assignment in the other pages for Session("ID"). set break point on session_onstart event to find when session got initialized

      N 1 Reply Last reply
      0
      • S Suamal

        In global.asax on Session_onStart initialize as Session("ID")=null and find whether there is any other assignment in the other pages for Session("ID"). set break point on session_onstart event to find when session got initialized

        N Offline
        N Offline
        Nagraj Naik
        wrote on last edited by
        #3

        Hi Saumal, We are meeting second time last time You teach lots to me. It may be my mistake that I could not find Global.Aspx in my application.I am using .net2005 (I know in .net2003 global.ascx present in current application folder)

        S 1 Reply Last reply
        0
        • N Nagraj Naik

          Hi Saumal, We are meeting second time last time You teach lots to me. It may be my mistake that I could not find Global.Aspx in my application.I am using .net2005 (I know in .net2003 global.ascx present in current application folder)

          S Offline
          S Offline
          Suamal
          wrote on last edited by
          #4

          You can add global.asax by choosing new item and global application class in .net 2005

          N 1 Reply Last reply
          0
          • S Suamal

            You can add global.asax by choosing new item and global application class in .net 2005

            N Offline
            N Offline
            Nagraj Naik
            wrote on last edited by
            #5

            Hi, Thanks,Ones again you solve my problem. I have added Session("ID")=null in Global.asax Now It's working fine. But Is there any problem if any another page in application assign value to Session("ID") Best Regards, Nagraj Let's Teach Life To Laugh....... -- modified at 8:03 Monday 19th June, 2006

            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