IMG-LOGO

How to overwrite the meta tags of a page in DNN?

andy - 25 Jul, 2013 3013 Views 0 Comment

The following code snippet will allow you to overwrite the meta tags of a page in DNN.

/* get the current dnn page framework object */
CDefault objPage = (CDefault)this.Page;

/* we set the meta tags of the page */
objPage.Title = "THIS IS THE META TITLE";
objPage.Description = "THIS IS THE META DESCRIPTION";
objPage.KeyWords = "THIS IS THE META KEYWORD";
If you can't find the keyword CDefault, you will need to import
using DotNetNuke.Framework;

or include full namespace like this
DotNetNuke.Framework.CDefault

Comments

There are no comments available.

Write Comment
0 characters entered. Maximum characters allowed are 1000 characters.

Related Articles

How to change copyright text in DNN?

In this article, I am going to show you how to change the copyright text in DNN. Usually, a copyright text is located under the footer of the site template.