I am in the process of converting an old VB.Net web-site I built over to C#. On the default page I define a series of Session values for reference on subsequent pages.
When I start to use them the ones that are predefined as string are available for reference. The ones that are predefined as some other type (i.e. integer, date) report the following error condition:
if (Session["WorkerID"] = 0)
Error: Cannot implicitly convert type 'object' to 'bool'. An explicit conversion exists (are you missing a cast)
I've Google'd the issue and so far nothing seems to address how to test the value of the WorkerId value as an integer. Can anyone help.
Steve
When I start to use them the ones that are predefined as string are available for reference. The ones that are predefined as some other type (i.e. integer, date) report the following error condition:
if (Session["WorkerID"] = 0)
Error: Cannot implicitly convert type 'object' to 'bool'. An explicit conversion exists (are you missing a cast)
I've Google'd the issue and so far nothing seems to address how to test the value of the WorkerId value as an integer. Can anyone help.
Steve