views:

192

answers:

2

Usually using Visual Studio's debugger is a breeze. Scanning through Locals quickly shows the values of variables, etc. However, I'm at a loss how to find out the values contained in session state variables? Can anyone give me a hand? Lets say I put a breakpoint right after:

Session("first_name") = "Rob Roy"
How do I view the value contained in Session("first_name") from locals?

A: 

Isn't it HttpContext.Current.Session("..."), I ask as I haven't used ASP.NET for a long time.

Preet Sangha
Hmmm...Wasn't able to find anything like that.
davemackey
+1  A: 

It's pretty simple to inspect the session during debug. Just put a breakpoint in your code and just highlight your Session code (eg. highlight: Session["first_name"]) then right click and select QuickWatch....

This will setup up a watch on your Session for the value you had defined. You can also inspect other Session elements by adjusting the Expression field in the QuickWatch window and clicking the Reevaluate button.

Kelsey
Thanks Kelsey! :)
davemackey
@davemackey If this helped you and is correct, please mark it as the correct answer :)
Kelsey
Done. Thanks. :)
davemackey
Thank you soo much, I've been going through those stupid tree menus and getting nowhere!!
Dal