I'm creating an UserControl and I'm passing a variable to it.
It works fine if I do it this way:
<uc:TestControl ID="testControl" runat="server" Variable="test"></uc:TestControl>
However I want to pass a dynamic variable to the control like this:
<uc:TestControl ID="testControl" runat="server" Variable="<%=dynamicVariable%>"></uc:TestControl>
But unfortunately that doesn't work and I know I could assign it on Page_Load but I don't like that way.
So I'm wondering if it's possible at all. Is there any way to assign a dynamic variable to an attribute like I wanted above? Or am I required to do it in Page_Load?
Any feedback would be appreciated! Thanks!