Home All Groups Group Topic Archive Search About
Author
31 Jul 2006 11:29 PM
Goldie
Can some please look at this function and maybe help me with why it's
not doing as it's told... :)

It's basicall meant to check to see if that field returned from
database actually has any data in it, and if not, return a display:none
style to hide it from the list

I'm trying to achieve not having to show every option of the columns in
that row, especially if the column is empty (no data)

Function code..
-----------------------
Function HideLink ( val )
                If field.IsEmpty(val) then
                        response.write("display:none")
                Else
                        response.write("")
                End If
        End Function

Use in page
----------------------

<a href="pdf/<%# Eval("content_type_msds") %>" <%# HideLink (
Container.DataItem("content_type_msds") )%>>MSDS</a>

Author
31 Jul 2006 11:52 PM
Scott M.
See responses in other NG.


Show quoteHide quote
"Goldie" <goldi***@gmail.com> wrote in message
news:1154388571.391688.98370@75g2000cwc.googlegroups.com...
> Can some please look at this function and maybe help me with why it's
> not doing as it's told... :)
>
> It's basicall meant to check to see if that field returned from
> database actually has any data in it, and if not, return a display:none
> style to hide it from the list
>
> I'm trying to achieve not having to show every option of the columns in
> that row, especially if the column is empty (no data)
>
> Function code..
> -----------------------
> Function HideLink ( val )
>                If field.IsEmpty(val) then
>                        response.write("display:none")
>                Else
>                        response.write("")
>                End If
>        End Function
>
> Use in page
> ----------------------
>
> <a href="pdf/<%# Eval("content_type_msds") %>" <%# HideLink (
> Container.DataItem("content_type_msds") )%>>MSDS</a>
>
Author
1 Aug 2006 4:52 PM
Göran_Andersson
Goldie wrote:
Show quoteHide quote
> Can some please look at this function and maybe help me with why it's
> not doing as it's told... :)
>
> It's basicall meant to check to see if that field returned from
> database actually has any data in it, and if not, return a display:none
> style to hide it from the list
>
> I'm trying to achieve not having to show every option of the columns in
> that row, especially if the column is empty (no data)
>
> Function code..
> -----------------------
> Function HideLink ( val )
>                 If field.IsEmpty(val) then
>                         response.write("display:none")
>                 Else
>                         response.write("")
>                 End If
>         End Function
>
> Use in page
> ----------------------
>
> <a href="pdf/<%# Eval("content_type_msds") %>" <%# HideLink (
> Container.DataItem("content_type_msds") )%>>MSDS</a>
>

1. Your function doesn't set any return value.

2. Your function is writing a string to the response stream while the
page is being parsed. The string will probably end up at the top of the
page.

3. You have forgotten to put the css style in the style property of the
tag. You are trying to use it as if the css style was an html property.