Issue with Session Variables

Welcome to Wisej Support.
Questions, suggestions and plain old bugs - are all welcome here!
0
0

Hi

I am having a problem using session variables in VB.net.

For example, the following line of code works.

Application.Session.UserCode = “Admin”

However, this doesn’t work.

x = Application.Session.UserCode

I have to enter

x = Application.Session(“UserCode”)

The equivalent code ‘x = Application.Session.UserCode;’ works in C#.

Am I doing something wrong?

Regards

Washington

Attachment
  • You must to post comments
0
0

Hi Washington,

in order to make x = Application.Session.UserCode work, you have to turn off Option Strict for your vb.net project.

(Section Compile in build options).

You can also turn it off as default for future vb.net projects in Tools / Options.

With Strict On you can only use the syntax x = Application.Session(“UserCode”).

Please note that the performance is the same as for the dynamix syntax.

Best regards
Frank

  • You must to post comments
Showing 1 result
Your Answer
Post as a guest by filling out the fields below or if you already have an account.
Name*
E-mail*
Attachment
File Name Size
There are currently no files uploaded.
Maximum number of files 5, maximum file size 3.9MB.
Supported file formats: zip pdf gif jpg bmp png cs vb theme json