Session/ViewState issues in Kentico 10

Austin Harmon asked on August 7, 2019 19:54

To Preface: I have tried doing this with ViewState and had the same results, I read that Session is better for performance and if possible it looks to be better so I'm trying to do this via Session if possible.

So I have a user control that is dynamically creating controls as the user clicks through buttons that hide and show divs based on the users selection.

This all works fine on my local instance. This is a plain ASP.NET web forms site that i have all the references to Kentico as well as an api I am using.

But when I put the control into Kentico 10 after I get past the first 2 button clicks when I try and reference a session variable I set from the first click it comes back as null instead of the value that I set.

To better illustrate:

  • There are five divs
  • Only one shows at a time
  • Once user gets to 3rd button I have a check to look at the first div selections to see what they picked
  • When I reference the Session Variable that was set back in the first button click it comes back as null in the third button click even though it was set.

I ran a test on my local versus on the server in kentico and my output for my session variables set so far in kentico read like this:

null null null null null null null null null null null

Where as on my local they returned like this:

on null null null on null null null null null null

Is there something that needs to be set in Kentico in order for multiple postbacks in a page work correctly? and values persist?

Thank you,

Austin

   Please, sign in to be able to submit a new answer.