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

  • Home
  • SEARCH
  • 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 88363
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 10, 20262026-05-10T22:32:54+00:00 2026-05-10T22:32:54+00:00

Here is the idea: When the user wants to see /controller/action, then I want

  • 0

Here is the idea:

When the user wants to see /controller/action, then I want the page to have a ‘robots’ meta tag with its value set to ‘all’. When the user wants to see /controller/action?sort=hot&page=2 (i.e. it has a query string), then I want the page to have a ‘robots’ meta tag with its value set to ‘noindex’. Of course this is just an example and it could be another tag for the existence of this question.

At what stage in the MVC architecture could I place a hook so that the view generates the tag I want in the master page?

  • 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. 2026-05-10T22:32:54+00:00Added an answer on May 10, 2026 at 10:32 pm

    I do something similar for generating page titles and it works well. Put your tag in your masterpage as normal:

    <%= Html.Encode(ViewData['Title']) %> 

    Then subclass ActionFilterAttribute and override OnActionExecuting. From there you get access to the controller context and can set your viewdata to whatever you want.

    public override void OnActionExecuting(ActionExecutingContext filterContext)     {         filterContext.Controller.ViewData['title'] = 'whatever';     } 

    last step is to put Attribute your controllers that you want to use the filter context. You can inherit from a base controller if you want to add the attribute to all classes. There are also overloads if you want to pass parameters. In my app. I actually pass the page title.

    Hope that helps.

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

Sidebar

Related Questions

I have a User class and want to display many users' thumbnails w/ their
For this question, I'm looking to see if anyone has a better idea of
I have a simple application with just a window and a user control. The
I'm creating a small program for viewing images. However, the whole idea is that
This has got to be one of the most frustratingly stupid bugs I have
I want to create a GUI in Oracle form 10g, the purpose of creating
Currently I want to optimize my 3d engine for consoles a bit. More precisely
I've read several comments here and elsewhere suggesting that Erlang's process dictionary was a
Thanks in advance for your help. I'm completely stumped on how I can do
I've been doing a bunch of searching and reading today, and haven't figured out

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.