function help please

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Goldie

    #1

    function help please

    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(v al) then
    response.write( "display:no ne")
    Else
    response.write( "")
    End If
    End Function

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

    <a href="pdf/<%# Eval("content_t ype_msds") %>" <%# HideLink (
    Container.DataI tem("content_ty pe_msds") )%>>MSDS</a>

  • Scott M.

    #2
    Re: function help please

    See responses in other NG.


    "Goldie" <goldie2k@gmail .comwrote in message
    news:1154388571 .391688.98370@7 5g2000cwc.googl egroups.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(v al) then
    response.write( "display:no ne")
    Else
    response.write( "")
    End If
    End Function
    >
    Use in page
    ----------------------
    >
    <a href="pdf/<%# Eval("content_t ype_msds") %>" <%# HideLink (
    Container.DataI tem("content_ty pe_msds") )%>>MSDS</a>
    >

    Comment

    • Göran Andersson

      #3
      Re: function help please

      Goldie wrote:
      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(v al) then
      response.write( "display:no ne")
      Else
      response.write( "")
      End If
      End Function
      >
      Use in page
      ----------------------
      >
      <a href="pdf/<%# Eval("content_t ype_msds") %>" <%# HideLink (
      Container.DataI tem("content_ty pe_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.

      Comment

      Working...