If you want to add note board web part by object model, here
is a simple way to add it. I have one web part page.
To demonstrate I have added this code in button click.
private void
button3_Click(object sender, EventArgs e)
{
using
(SPSite site =
new SPSite("{Site URL}"))
{
using
(SPWeb web = site.OpenWeb())
{
SPLimitedWebPartManager webPartManager =
web.GetLimitedWebPartManager("SitePages/NoteBoard.aspx",
System.Web.UI.WebControls.WebParts.PersonalizationScope.Shared);
SocialCommentWebPart noteboardwp =
new SocialCommentWebPart();
webPartManager.AddWebPart(noteboardwp ,
"MiddleZone", 0);
}
}
}
and here is what you get out of it
No comments:
Post a Comment