Function calling (newbie?)

G

Gmansky

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
 
E

EijiTek

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.
 
C

Craig Deelsnyder

<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
 

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,767
Messages
2,569,572
Members
45,045
Latest member
DRCM

Latest Threads

Top