Scenario:
Validating content type name while creating programaticaly
Solution:
Code:
// Decide on a name for the new content type.Output
string contentTypeName = "R&D";
try
{
SPContentType.ValidateName(contentTypeName);
}
catch (SPException ex)
{
Console.WriteLine(ex.Message);
}
The content type name cannot contain: \ / : * ? " # % < > { } | ~ &, two consecutive periods (..), or special characters such as a tab.
0 comments:
Post a Comment