This topic is locked

Session variable in lookup where clause - error

3/5/2016 11:20:47 AM
ASPRunner.NET General questions
T
tomriggall author

Hello.

I am trying to add a session variable into a where clause for a lookup wizard, but when I load the page I get an error:
Server Error in '/' Application.
An expression of non-boolean type specified in a context where a condition is expected, near ')'.
My where clause looks like this:
" AdminContactID = " + XSession.Session["OwnerID"] + " "
AdminContactID is numeric. I have tested this by replacing the session variable with simply a static number, and it works. I've also printed the session variable to the webpage and it is indeed numeric and properly populated.
Any thoughts?

Thanks.

Sergey Kornilov admin 3/11/2016

I guess you need to make sure that XSession.Session["OwnerID"] session variable is populated. If you are looking to use a built-n ASPRunner.NET OWnerID variable correct syntax is XSession.Session["_<table name>_OwnerID"]. Make sure to replace <table name> with the actual table name.