Wrong use of OR? Thanks

M

Miguel Dias Moura

Hi,

i want to make a table visible if any of 3 database field values are
different from "".

The code i have is this:

visible='<%# dataSetPerson.FieldValue("Value1", Container) <> "" OR
dataSetPerson.FieldValue("Value2", Container) <> "" OR
dataSetPerson.FieldValue("Value3", Container) <> "" %>'

This is not working. I am using ASP.NET / VB.

Thanks,
Miguel
 
G

Guest

Miguel,
Can try using a helper function instead?

I'm pulling the syntax off my head so watch out for syntax errors.

For example:
codebehind
-------------
Protected Function ShowTable(val1 As Object, val2 As Object, val3 As Object) As Boolean
'Do your logic here and return True or False
End Function

aspx
------
visible='<%# ShowTable(DataBinder.Eval(Container.DataItem, "Value1"),
DataBinder.Eval(Container.DataItem, "Value2"),
DataBinder.Eval(Container.DataItem, "Value3") )%>'

HTH,
Suresh.
 

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

Forum statistics

Threads
473,774
Messages
2,569,599
Members
45,163
Latest member
Sasha15427
Top