Trimming a String Function with ASP.NET and VB.NET
I'm trying to run a simple function on a dataset field but can not for the life of me figure out how to get it to work.
All I want to do it trim the text that is output by some bound data. The function I have written is below
Code:
<script runat="server">
Function TrimTeaser( strString As String)
strString = strString.Substring (0,4)
End Function
</script>
On the page:
Code:
<%# TrimTeaser(ds_main_news.FieldValue("headerText", Container)) %>
I have tried so many variations and all either complain of missing Expressions, no String data, or it simply does not print to the page. Help!
Cheers,
Jeff