Problem: <%= %> is not evaluated..

Discussion in 'ASP .Net Building Controls' started by ruskie, Oct 13, 2004.

  1. ruskie

    ruskie Guest

    I created a user control with two public properties and drop it to an aspx
    page as the following

    <uc1:myUserControl
    id="myUserControl1"
    runat="server"
    MyProperty1="<%= this.MyVar1 %>"
    MyProperty2="<%= this.MyVar2 %>" >
    </uc1:myUserControl>

    Why the "<%= this.MyVar1 %>" and "<%= this.MyVar2 %>" are not evaluated and
    returned as raw string instead?
    Thanks
     
    ruskie, Oct 13, 2004
    #1
    1. Advertising

  2. Ruskie,

    The server side directives will not evaluate unless you call the
    databind method on the user control. Did you do that?

    sayed

    "ruskie" <> wrote in message news:<>...
    > I created a user control with two public properties and drop it to an aspx
    > page as the following
    >
    > <uc1:myUserControl
    > id="myUserControl1"
    > runat="server"
    > MyProperty1="<%= this.MyVar1 %>"
    > MyProperty2="<%= this.MyVar2 %>" >
    > </uc1:myUserControl>
    >
    > Why the "<%= this.MyVar1 %>" and "<%= this.MyVar2 %>" are not evaluated and
    > returned as raw string instead?
    > Thanks
     
    Sayed Hashimi, Oct 13, 2004
    #2
    1. Advertising

  3. ruskie

    ruskie Guest

    I added a pound sign then call Page.DataBind in the parent page. And it
    works, thanks for all suggestion. My problem solved.


    "ruskie" <> wrote in message
    news:...
    >I created a user control with two public properties and drop it to an aspx
    > page as the following
    >
    > <uc1:myUserControl
    > id="myUserControl1"
    > runat="server"
    > MyProperty1="<%= this.MyVar1 %>"
    > MyProperty2="<%= this.MyVar2 %>" >
    > </uc1:myUserControl>
    >
    > Why the "<%= this.MyVar1 %>" and "<%= this.MyVar2 %>" are not evaluated
    > and
    > returned as raw string instead?
    > Thanks
    >
    >
     
    ruskie, Oct 14, 2004
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Jason Wright via .NET 247
    Replies:
    2
    Views:
    728
    Brian W
    Jun 12, 2004
  2. ruskie

    Problem: <%= %> is not evaluated..

    ruskie, Oct 13, 2004, in forum: ASP .Net
    Replies:
    3
    Views:
    300
    ruskie
    Oct 14, 2004
  3. Replies:
    0
    Views:
    461
  4. Chris
    Replies:
    1
    Views:
    3,982
    Christophe Vanfleteren
    Jan 9, 2004
  5. ruskie

    Problem: <%= %> is not evaluated..

    ruskie, Oct 13, 2004, in forum: ASP .Net Web Controls
    Replies:
    2
    Views:
    119
    ruskie
    Oct 14, 2004
Loading...

Share This Page