I have an ASP control custom built and I need to pass a value taken from a session variable to it like so:
<custom:control id='mycontrol' value="+Session['myControlValue']+">
...
</custom:control>
the above code obviously doesn’t work, I need a way to insert the Session value in the control in this way somehow, can anyone help?
If it is a data bound control you may try this:
Personally I would prefer setting this value from the code behind. It seems a little strange to me that a view (aspx) page manipulates the session: