Help Pls - declarative data binding

G

Guest

Hi,

I am trying to do something like this in html:

<% if(user.isBrowseActive()) { %><td nowrap="nowrap" class="browse"><a
href="swzBrowse">Browse</a></td><%}%>

except I want to replace the user.isBrowseActive() with a declarative
databinding statement like:

<%# myProperty %>

any ideas on how I can do this - been googling for a while with no luck.

thanks in advance!
Bill
 
G

Guest

Hi Karl,

Thanks for the quick reply, but I still can't quite figure out how to make
this work based on an "if" like:

<%# if(UserAdminFlag){ %> <li><a
href="Admin.aspx">Administration</a></li><%}; %>

that won't work because you need to have the property to bind immediately
following the <%# UserAdminFlag %>

I couldn't find any examples for what I am trying to do - maybe it can't be
done this way.

thanks!
Bill
 
K

Karl Seguin [MVP]

why not just do:

<li runat="server" visible='<%# DataBinder.Eval(Container.DataItem,
"UserAdminFlag")'><a href=....>aa</a></li>

Karl
 
G

Guest

Karl,

Thanks much! Perfect!

regards,
Bill


Karl Seguin said:
why not just do:

<li runat="server" visible='<%# DataBinder.Eval(Container.DataItem,
"UserAdminFlag")'><a href=....>aa</a></li>

Karl
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,902
Latest member
Elena68X5

Latest Threads

Top