Hi All,
I have asp.net application which creates "object reference not set" error only in some rare cases. I very well know what does this error mean. It is generated when some one try to access attributes or method of any object which is null. But my question is, how can I know what is the name of the object which has generated this error.
try
{
string s = Session["Hi"].tostring () <-- this is used for the very first time and hence will create above mentioned error.
}
catch(exception ex) <-- I also tried nullrefernece exception here
{
WHAT SHOULD I DO HERE TO GET THE NAME OF OBJECT WHICH CAUSES THIS EXCEPTION -- in this case session["hi"]
}
Thanks for your time.
-Hitesh
...
Go to the complete details ...