Custom Module Url is accepting wierd characters
I'm noticing the generated urls for some of our resources are containing periods...where is it that I can tell it to filter those out?
Hello Steve,
I suspect that you creating your items using code. If your items are created using Sitefinity UI their URLs are set correctly but when creating items using code you should add the following:
private
const
string
UrlNameCharsToReplace = @
"[^\w\-\!\$\'\(\)\=\@\d_]+"
;
private
const
string
UrlNameReplaceString =
"-"
;
item.SetValue(
"UrlName"
,
new
Lstring(Regex.Replace(artistName, UrlNameCharsToReplace, UrlNameReplaceString)));
Nope, everything is created in the backend UI. The guy entering the items put periods in the title like this (minus the quotes)
Group 30. Article 5.
FYI I was also just able to make a blog post (not custom module) and it put periods in the URL