I want to pass variables to a usercontrol before it renders on my page.
The way my control works, several properties that are set in the code-behind are saved in session variables, and then these session variables are used in the html to set some values of the usercontrol. I use something like:
var myJavascriptVariable = <%=session("something") %>
I suppose I could put my control inside an UpdatePanel, and every time the program wants to change something like one of these values, it could refresh the entire update panel.
But since I know all the values in advance of creating the control, it would be nice to pass them all at once in a constructor, before the control renders.
I could create the usercontrol, then set all its properties, then refresh it just once.
Is there a better way?
Thanks,
Gideon
Go to the complete details ...