How do I?

  • Thread starter Thread starter Mr Ideas Man
  • Start date Start date
M

Mr Ideas Man

Trying to use a DataItem value in an if statement.

Cause it isn't a data binding expression..'Container' is not recognised.

Is there some other way i can get at this value???

It is contained within a Datalists item template.

<%If(IsDBNull(Container.DataItem("crbk_disabled_session_id"))) Then %>
<asp:ImageButton ID="ibtnDisableSession"
CommandName="DisableSession" Runat="server" ImageUrl="btnAdd.gif"/>
<% End If %>

Cheers,
Adam
 
USe the binding expression :P

<%# if(.... %>

but you know, there's even a better way:

<asp:ImageButton... visible='<%# IsDbNull(Container.Data....%>' />

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

Back
Top