Skip to main content

Posts

Showing posts from 2011

PublishingAssociatedContentType

The Content Type to be associated with a page layout is indicated by the 'PublishingAssociatedContentType'. In the actual sense it means a binding setting between the Page Layout and the content type. If you fail to provide one, the SharePoint framework will make use of the Page Content type. The format of the binding is: ';# e.g. ';#ContentPage;#0x010100C568DB52D9D0A14D9B2FDCC96666E9F2007948130EC3DB064584E219954237AF3900470b13dd348649d08f9e5151501df9a4000dbd46dad8d045f98c83ad983b66d3f2;#'. where Content Type name: ContentPage Content Type ID: 0x010100C568DB52D9D0A14D9B2FDCC96666E9F2007948130EC3DB064584E219954237AF3900470b13dd348649d08f9e5151501df9a4000dbd46dad8d045f98c83ad983b66d3f2 respectively. QED

INSERT KEYWORDS AND DESCRIPTION INTO A PAGE PROGRAMMATICALLY

In other to build the right asp.net site, there is always a need to inject keywords and description for search engines to crawl. So to do that quickly... Of course, the simplest way to add these tags is manually to the HTML part of your ASP.NET page like this: System.Web.UI.HtmlControls.HtmlMeta mKeywords = new System.Web.UI.HtmlControls.HtmlMeta(); mKeywords.Name = "MyKeywords"; mKeywords.Content = "meta1, meta2, meta3"; Page.Header.Controls.AddAt(1, mKeywords); System.Web.UI.HtmlControls.HtmlMeta mDescription = new System.Web.UI.HtmlControls.HtmlMeta(); metaDescription.Content = "This page does a lot"; mDescription.Name = "MyPage"; Page.Header.Controls.AddAt(1, mDescription); In other to create a page in ASP.NET in the latest framework: Page.mDescription = "this is my description."; Page.mKeywords = "key1, key2, key3"; What about assets include, HtmlLink mlink = new HtmlLink(); mlink.Href = relativePath; mlink.Attr...