Breakpoint on a session variable

  • Thread starter Thread starter uneboite
  • Start date Start date
U

uneboite

Hi!

I'm new to .net so please don't be too hard on me if my question is
not appropriate...

In debug execution, is there a way to make an application stop when a
session variable's value changes?
 
Your questions a bit unclear......

A request is for a page (unless its a web method in a webservice or an Ajax
call). The page resides within a web application - if all you want to do is
terminate the request from within that page when a value gets changed as the
page is progressed, check the value then issue a response.end. What you
cant do is monitor the session globally at the application level for a
session value to change, in effect listening to it somehow and ending the
response from anywhere other than in the page being requested. So, I think
your answer will be no, if I've understood correctly what your asking for.

Regards

John Timney (MVP)
http://www.johntimney.com
http://www.johntimney.com/blog
 
hmm, trying to give a clearer example here:

let say in my page_load method i have at different places:
Session("haha")=0
..
..
..
Session("haha")=5
..
..
..
Session("haha")=2

in lots of different "if" structures

Runnning In debug, is there a way to make the debugger stop the
execution when the Session("haha") changes without explicitly putting
a breakpoint on each session("haha") lines?

I think we can do that with memory adresses. You can put a breakpoint
(a "watch" in old vax/vms terms...), a "watch point",
to tell the debugger to stop the execution when a specific memory
address value changes.


Thanks
 
I personally don't know of any way you can stop in your application
everytime the value of your Session variable changes. However, what
you can do is place your session variable into your watch window. This
way, while you are debugging through code, you can keep your eye on
your watch window and see when the Session variable changes.

If you don't know or don't see what your watch window is - when you're
in debug mode (I'm personally using VS 2005), just click on Debug -->
Windows --> Watch. I think to get to it in VS 2003, you have to click
on the View menu. Anyways, hope that helped!

Ankit Mathur - MCAD.NET
 
Back
Top