I actually had tried that - initially - I get with the above:
The server tag is not well formed.
lunadl
oh is 'no title' a field in the database or something? if so try this isvisible='<%# Eval("no title")%>' .. are you trying to get it to return true or false? If you are, then you want to disallow nulls in the DB or write a function that checks for them before writing the true/false here: isvisible='<%# isNullFunction(Eval("no title"))%>'
'no title' is text data that is appearing - and I'm trying to not get it to display.
lunadl
ok then instead of using isNullFunction, make a isTitleFunction that tests for null, none, or exists then return true or false
isvisible='<%# isTitleFunction(((Publication) Container.DataItem).Title)>'
andrewjb
The string delimiter is " not '
So it should be
"no title"
rather than
'no title'
shouldn't it?
(Though this isn't winforms, which is my world, so maybe that's tosh)
So I wrote a simple - isTitleFunction below and I'm getting an odd error:
CS0030: Cannot convert type 'void' to 'bool'
which is this line that was added yesterday:
<fc:ConnectDisplay isvisible='<%# isTitleFunction(((Publication) Container.DataItem).Title)%>' runat="server">
<script language=C# runat=server>
public void isTitleFunction(string e)
{
if(e != null)
{
e.Replace("no title","");
}
}
</script>
lunadl
the type should be object and not string..it may be trying to cast an null to a string which throw an error.... try object e instead of string e... test for null then if it is not null then test the value.
I'll play with it more tomorrow - if I still don't have it - I'll just give you the points - this appears to be one that could go on for a while but I think we're close.
dylanone
ASKER
Thanks - I never got this one working 100% correctly but at least I have several ideas now!
<fc:ConnectDisplay isvisible='<%# (((Publication) Container.DataItem).Title != @'no title')%>' runat="server">