I'm currently converting my WSPs
application into WAPs
for security purpose.
but I got some issue, I can't call the Public function on aspx
source in WAPs
, on WSPs
aspx
source and WAPs
codebehind there's no issue.
Here's the function ;
namespace WAUGHI
{
public static class PublicVar
{
public static string Expurgate(this string TargetStr, int MaxLenght)
{
if (TargetStr.ToCharArray().Count() > MaxLenght)
{
return TargetStr.Substring(0, MaxLenght) + "...";
}
else return TargetStr;
}
} }
the function cut the string if the string exceed the limit on define length.
calling the function like this on aspx source
Text='<%# DataBinder.Eval(Container, "DataItem.Categories").ToString().Expurgate(24) %>'
e.g.
string = "Hung Hang is not chinese, guess?"
the output is "Hung Hang is not chinese..."