Session State and Custom Controls

Hello,<BR><BR>I'm having a problem using session state variables in a custom control. First of all, I tried setting a custom control's property using server side script and got an error saying that you can not put server side script in a server tag.<BR><BR>eg. <myprefix:mycontrol someproperty="<%=Session("SomeVar")%>" /><BR><BR>Another thing. In my render event of my custom control I need to use Session variables. I know I can pass them from what ever page is using the control, but I'd like the code to be contained within the custom control. How come I can not access Session state within the custom control class itself???<BR><BR>Please Help, <BR><BR>RobIf i remember correctly asp controls do not allow you to pass secondary asp code like what your doing. This code will not even work in datagrid or any other vb.net controls. Therefore your code someproperty="<%=session("somvar")%>" will generate a big old error. As for a work around, well sorry I'm don't have one.
 
Back
Top