Wednesday 23 March 2011

Strip non word or sanitizing text in DotNetNuke

Sometimes in DotNetNuke we would like to prepare some text to the sanitized form. This is very common task for preparing FriendlyUrls. I would like to recommend to use core DNN method:

public static string StripNonWord(string HTML, bool RetainSpace)
Member of DotNetNuke.Common.Utilities.HtmlUtils

It allows to remove not only spaces, but also all non-URL characters.

BTW: This function used in Core DNN on Tabs updating.

Hope this helps!

No comments:

Post a Comment

Note: only a member of this blog may post a comment.