سؤال

I want to create a site with a title provided from a user and use the title as the site url. However I want to remove spaces and diacritics.

I replace spaces with a hyphen, and I run RemoveDiacritics as described here.

Is there a suitable method in Sharepoint API (like SPUtility or so) to achieve this goal.

هل كانت مفيدة؟

المحلول

Here's an article from Microsoft Support on invalid characters in Sites:

http://support.microsoft.com/default.aspx?scid=kb;en-us;905231

I'm not aware of anything in the SharePoint API that would handle this for you. You can obviously take what Microsoft puts out there in the above article and write some code and/or some regular expressions to enforce those rules. This is an article I had referenced in the past on file names...and while it's not 100% identical to the rules on site titles it's a good place to start:

http://simplyaprogrammer.com/2008/05/importing-files-into-sharepoint.html

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى sharepoint.stackexchange
scroll top