0

Implementing property bag to change Project description of site collection with below code ,But finding no luck.

Can any one help me in knowing what went wrong in my below code

SPSite mysite = properties.Feature.Parent as SPSite;<br>
SPWeb myweb = mysite.RootWeb;<br>
var mybag = myweb.AllProperties;<br>
mybag["Description"] = "SharePoint Training";<br>
myweb.Update();
0

You dont need to update property bag.

Try the below code:

SPSite mysite = properties.Feature.Parent as SPSite;
SPWeb myweb = mysite.RootWeb;
myweb.Description = "SharePoint Training";
myweb.Update();

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.