1

I am trying to localize content type, site columns, list with no luck . I have created the site columns , content types using CSOM. Here is my code of creating content type. i have tried to call as $Resources.SiteCol_ContentType_Title but its not working

public void CreateContentType(ClientContext ctx, string ctTitle, string ctDescription, string ctId)
    {
        try

        {
            if (!ctx.Web.ContentTypeExistsById(ctId))
            {
                ctx.Web.CreateContentType(ctTitle, ctDescription, ctId, ContentTypes.DefaultCTGroup);
            }
        }
        catch (Exception ex)
        {
            logErrors(ctx, "cannot create content type", ex.Message);

        }
    }

created one .cs file for getting the name,displayname and id of content type .

public class ContentTypes
{      
    public const string TestCtTitle = "TestCT";
    public const string TestCtId = "0x0100A07C46CB2F9A46C4A32B831A1716EAB8";
    public const string TestCtDesc = "test content type";      
}

any one has done?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.