+ Reply to Thread
Results 1 to 2 of 2

Thread: Passing dynamic variable to UserControl

  1. #1

    Passing dynamic variable to UserControl

    I'm creating an UserControl and I'm passing a variable to it.
    I want to pass a dynamic variable to the control like this:
    Code:
    <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.

  2. #2
    Try using the databind syntax
    Code:
    Variable="<%#dynamicVariable%>"
    That should work as syntax doesn't work with controls marked as runat="server"

+ Reply to Thread

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts