Function calling (newbie?)

Discussion in 'ASP .Net' started by Gmansky, Jun 27, 2004.

  1. Gmansky

    Gmansky Guest

    I am having difficulty trying to output a function that I created on the
    codeblock of my aspx page.

    I have a
    function displaytext(mytext as string)
    displaytext = replace(mytext, vbcrlf, "<br>")
    end function

    I'm getting an error when I use this on the html side
    <td>
    <%# displayText(<%#container.dataitem('Description')%>) %>
    </td>

    What is the correct way of calling a function and passing a data from the
    repeater?

    Thanks,
    George
    Gmansky, Jun 27, 2004
    #1
    1. Advertising

  2. Gmansky

    EijiTek Guest

    Take the function call out of the server side databind tag, you've already
    instructed the server to process the data. Also, make sure that you're
    calling Page.DataBind().

    If these suggestions don't work, please post more information such as the
    actual error you're receiving and more of the page code.

    "Gmansky" <> wrote in message
    news:eWA$...
    > I am having difficulty trying to output a function that I created on the
    > codeblock of my aspx page.
    >
    > I have a
    > function displaytext(mytext as string)
    > displaytext = replace(mytext, vbcrlf, "<br>")
    > end function
    >
    > I'm getting an error when I use this on the html side
    > <td>
    > <%# displayText(<%#container.dataitem('Description')%>) %>
    > </td>
    >
    > What is the correct way of calling a function and passing a data from the
    > repeater?
    >
    > Thanks,
    > George
    >
    >
    >
    >
    >
    EijiTek, Jun 27, 2004
    #2
    1. Advertising

  3. On Sun, 27 Jun 2004 08:41:13 -0700, Gmansky <> wrote:

    > <td>
    > <%# displayText(<%#container.dataitem('Description')%>) %>
    > </td>


    I think this may be what the other response is trying to say (wasn't sure):

    <td>
    <%# displayText(container.dataitem('Description')) %>
    </td>

    note the removed 'inner bind statement'...doesn't work that way

    --
    Craig Deelsnyder
    Microsoft MVP - ASP/ASP.NET
    Craig Deelsnyder, Jun 27, 2004
    #3
  4. Gmansky

    EijiTek Guest

    Yeah, that's exactly what I was saying. I should have posted the code.
    Sorry!

    "Craig Deelsnyder" <cdeelsny@no_spam_4_meyahoo.com> wrote in message
    news:eek:pr99w6rg775dg5d@cowboy...
    > On Sun, 27 Jun 2004 08:41:13 -0700, Gmansky <> wrote:
    >
    > > <td>
    > > <%# displayText(<%#container.dataitem('Description')%>) %>
    > > </td>

    >
    > I think this may be what the other response is trying to say (wasn't

    sure):
    >
    > <td>
    > <%# displayText(container.dataitem('Description')) %>
    > </td>
    >
    > note the removed 'inner bind statement'...doesn't work that way
    >
    > --
    > Craig Deelsnyder
    > Microsoft MVP - ASP/ASP.NET
    EijiTek, Jun 28, 2004
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Replies:
    5
    Views:
    577
  2. Andreas Lagemann
    Replies:
    8
    Views:
    461
    Mike Wahler
    Jan 10, 2005
  3. tiwy
    Replies:
    0
    Views:
    426
  4. NoWonder
    Replies:
    2
    Views:
    291
    Matthias Kaeppler
    Apr 9, 2005
  5. Satish Chimakurthi

    Function calling another function

    Satish Chimakurthi, Mar 1, 2004, in forum: Python
    Replies:
    2
    Views:
    360
    Satish Chimakurthi
    Mar 1, 2004
Loading...

Share This Page