Search code examples
dotnetnuke-module2sxc

Set page title from 2sxc dnn module


How can I change page title from module razor code? I have news module on page site.name/news, and it is called with news id eg.: site.name/news/newid In this page I display different news and I also want to set different html title for each of this pages. How can I do this?


Solution

  • this works, another option is to do it through JS

    advantages

    1. future-compatible when dnn moves to mvc
    2. still google compliant

    disadvantage

    1. not in the html for any external services which don't parse JS, like facebook