How to determine datatype of session variable?http://forums.asp.net/t/1779512.aspx/1?How+to+determine+datatype+of+session+variable+Mon, 12 Mar 2012 20:26:12 -040017795124876159http://forums.asp.net/p/1779512/4876159.aspx/1?How+to+determine+datatype+of+session+variable+How to determine datatype of session variable? <p>I am using a session variable to store a date however, on rare occasions there is no value for the date so I get an empty string return value instead of a date.&nbsp; How do I check to see if I'm getting a date or a string when I try to use the session variable?</p> 2012-03-12T20:22:50-04:004876164http://forums.asp.net/p/1779512/4876164.aspx/1?Re+How+to+determine+datatype+of+session+variable+Re: How to determine datatype of session variable? <p>Cast to an object and then use GetType.</p> <pre>object a = (object)Session[&quot;MYS&quot;];</pre> <pre>a.GetType</pre> <pre></pre> <p><a href="http://msdn.microsoft.com/en-us/library/system.object.gettype.aspx">http://msdn.microsoft.com/en-us/library/system.object.gettype.aspx</a></p> <p></p> <p>I hope this can help you</p> 2012-03-12T20:26:12-04:00