Re: <%# IsEditable %> and <%= IsEditable %>



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



.