Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 336587
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T10:15:24+00:00 2026-05-12T10:15:24+00:00

in webforms I would always use my masterpage to set page titles and meta

  • 0

in webforms I would always use my masterpage to set page titles and meta description based on the current url. I was thinking of doing the same for my Asp.net Mvc projects but I ain’t sure where to start. It would be nice to be able to set the title/description based on the controller and/or action with some default values incase I don’t specify any info. The reason why I do this is because I like everything to be in one place because that makes it easy to spot mistakes.

Edit:
After reading the answers and googling some I was thinking it might be cool to get the info from an xml file. With Xml looking something like this:

<website title="default title for webpage">
    <controller name="HomeController" title="Default title for home controller"> 
       <action name="Index" title="title for index action" />
    </controller>
</website>

I am new to Asp.net Mvc so I am not sure where to initialize this.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-12T10:15:24+00:00Added an answer on May 12, 2026 at 10:15 am

    So after a few days of trying stuff I ended up with making a custom filter that reads from a XML file.

    I added the code to copypastecode.com
    http://www.copypastecode.com/9797/
    http://www.copypastecode.com/9809/
    http://www.copypastecode.com/9805/

    I am very novice at Asp.net Mvc and “real” C# coding so if you see strange stuff please forgive me. If somebody wants to optimize it or has a better solution feel free to post it as an answer.

    Next thing I am gonna try is to make it without a filter so it’s activated on all controllers. Not sure where to hook up the logic though. So if anybody can push me into the right direction let me know.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I use webforms/masterpage, with .NET. I Have many Web User Controls into my page.
I'm using Phil Haack's URL routing for WebForms and I would like to define
In ASP.NET WebForms, I can use the CodeBehind of a master page to fetch
In standard WebForms, I would have a handful of properties, and set those. Then
On my asp webforms app I would do the log4net initialization; log4net.Config.XmlConfigurator.Configure(); on global.asax
When using ASP.net webforms my usual solution would have following type of setup -
I am using the webform module for Drupal 6 and would like to set
I'm using .NET webforms. I have a grid view that can use Eval(Name) in
I would like to know is this platfoerm (MVC or WebForms) good technology of
In ASP.NET webforms I used to write AJAX apps where the client would communicate

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.