Sep 18, 2006 #1 daughtd Programmer Sep 6, 2006 15 US I need to check for the existance of a session variable using an if statement. How can this be done? Ex: If (SessionVar Exists){ }else{}
I need to check for the existance of a session variable using an if statement. How can this be done? Ex: If (SessionVar Exists){ }else{}
Sep 18, 2006 #2 TipGiver Programmer Sep 1, 2005 1,863 This has to do with ASP.NET - forum855 To answer you, try : if (Session("name") == null) { // not exist } else { // exist } But, when a session ends, the vars are lost I think. Upvote 0 Downvote
This has to do with ASP.NET - forum855 To answer you, try : if (Session("name") == null) { // not exist } else { // exist } But, when a session ends, the vars are lost I think.