You should always check if an session variable is null or not.
the string conversion does not fail because a string can be null. A float can't.
Debug the following and check the results
'myobject' is bassically the same as the Session. The Session will return an object.Code:object myobject = null; string s = (string)myobject; float f = (float)myobject;
Anyway, 's' will be null and an error will occur on the float line..




Reply With Quote