Re: <%# IsEditable %> and <%= IsEditable %>
- From: bruce barker <nospam@xxxxxxxxxx>
- Date: Thu, 13 Sep 2007 14:53:14 -0700
no.
<%= expression %> is translated to:
Controls.Add(new Label(expression));
where <asp:label id=lb1 Visible=<%=expression%> /> is translated to:
lb1 = new Label();
lb1.Visible = "<%=expression%>";
and when databind is called, it checks for properties with binding expressions, evals the expression, and sets the property to the value.
-- bruce (sqlwork.com)
Max2006 wrote:
Hi,.
When I use this tag:
<asp:lable . Visible='<%# IsEditable %>'
I have to do DataBind so the binding takes place.
I am trying to use the following notation to do the similar thing without forced to call DataBind method:
<asp:lable . Visible='<%= IsEditable %>'
But I receive this error:
Generation of designer file failed: Cannot create an object of type 'System.Boolean' from its string representation '<%= IsEditable %>' for the 'Visible' property.
Is there any way to use <%= IsEditable %> instead of <%# IsEditable %> to avoid calling the DataBind?
Thank you,
Max
- Follow-Ups:
- Re: <%# IsEditable %> and <%= IsEditable %>
- From: Max2006
- Re: <%# IsEditable %> and <%= IsEditable %>
- References:
- <%# IsEditable %> and <%= IsEditable %>
- From: Max2006
- <%# IsEditable %> and <%= IsEditable %>
- Prev by Date: Re: The IListSource does not contain any data sources.
- Next by Date: Re: Lifecycle question regarding master pages
- Previous by thread: Re: <%# IsEditable %> and <%= IsEditable %>
- Next by thread: Re: <%# IsEditable %> and <%= IsEditable %>
- Index(es):