Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeUsing DNN Platf...Using DNN Platf...Administration ...Administration ...Overriding Page Title by editing *.ascx?Overriding Page Title by editing *.ascx?
Previous
 
Next
New Post
8/21/2011 3:52 PM
 
DNN: 5.6.3

Guys when working with modules, can I override PageTitle by editing *.ascx files?

For instance, i have a blog module and module's search page uses home page's title and other meta information by default. However, i want to override default page title. I don't have source code files (e.g *.vb).

So is this possible? If so how? I would appreciate a sample.
Thank you.

Or-Rouge Team Or-Rouge
Personally recommend Hostgator for hosting single or multiple DotNetNuke Websites.
DotNetNuke Tips and Tutorials
Install DotNetNuke to Godaddy root
DotNetNuke Türkçe Hakkinda Hersey
 
New Post
8/21/2011 4:14 PM
Accepted Answer 
Changing the page title from a module can be done by casting a reference to the current page. Typically this is something you would do in the code behind (i.e ascx.vb/ascx.cs) - if you only have an ascx you can try using inline code blocks (<%...%>) e.g.
<%
DotNetNuke.Framework.CDefault tp = (DotNetNuke.Framework.CDefault)this.Page;

tp.Title = "This is my page title";
%>

Buy the new Professional DNN7: Open Source .NET CMS Platform book Amazon US
 
New Post
8/21/2011 4:27 PM
 
Yes, i only have access to ASCX. Does using inline code blocks cause any negative impact compared to first method?

Or-Rouge Team Or-Rouge
Personally recommend Hostgator for hosting single or multiple DotNetNuke Websites.
DotNetNuke Tips and Tutorials
Install DotNetNuke to Godaddy root
DotNetNuke Türkçe Hakkinda Hersey
 
New Post
8/21/2011 4:42 PM
 
no, its fine - lots of people use inline code to inject server control ids into javascript - the main disadvantage is that it encourages spaghetti code -you can read up on inline code @ http://weblogs.asp.net/ahmedmoosa/archive/2010/10/06/embedded-code-and-inline-server-tags.aspx

Buy the new Professional DNN7: Open Source .NET CMS Platform book Amazon US
 
New Post
8/21/2011 4:52 PM
 
Cathal, your help is appreciated. A nice chat here, let me expand my question. What if module gets updated regularly by developer, so i upload each new release to my site and to avoid modifying ascx file manually, can I be a smart one and use the code directly in resx files? :)

Or-Rouge Team Or-Rouge
Personally recommend Hostgator for hosting single or multiple DotNetNuke Websites.
DotNetNuke Tips and Tutorials
Install DotNetNuke to Godaddy root
DotNetNuke Türkçe Hakkinda Hersey
 
Previous
 
Next
HomeHomeUsing DNN Platf...Using DNN Platf...Administration ...Administration ...Overriding Page Title by editing *.ascx?Overriding Page Title by editing *.ascx?


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out