Passing RedDot placeholders into a .Net variable

24 views
Skip to first unread message

RustyLogic

unread,
Jun 18, 2008, 6:55:45 AM6/18/08
to RedDot CMS Users
Handy tip:

As mentioned before in this forum, the following won't work if there
are special characters in the text:

string articleText = "<%txt_bodyText%>";

But, we can use:

string articleText ="<%!! Escape:HtmlEncode(<%txt_bodyText%>) !!%>";

Unfortunately the HTMLEncode function is broken (sorry, I mean it has
the following 'expected behaviour'):
If the txt_bodyText is empty then HtmlEncode returns "()". Don't ask
me why!

So to get around that we do the following:

string articleText="";
<!IoRangeConditional>articleText ="<%!! Escape:HtmlEncode(<
%txt_bodyText%>) !!%>";<!/IoRangeConditional>

articleText now contains txt_bodyText!

Ta,
John
Reply all
Reply to author
Forward
0 new messages