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 3233612
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T17:17:49+00:00 2026-05-17T17:17:49+00:00

I have 2 master pages. One is intended to be shown in a normal

  • 0

I have 2 master pages. One is intended to be shown in a normal standalone website. The other is to be used in external sites as an Iframe.

I want to be able to show the normal page at http://example.com/home/index and the iframed version at http://example.com/framed/home/index

I want to have controls that will postback to one controller so I don’t have to duplicate logic, so they must be available in both the normal and iframed versions.

My problem is that when I try and use areas, I just can’t get them to work right with the default url. Also, I have the added complication of structuremap. When I try and hit /area/controller/action, I get

The IControllerFactory
‘MySite.Web.Code.IoC.StructureMapControllerFactory’
did not return a controller for the
name ‘MyArea’.

Does anyone know how to make this kind of setup work? Really all I’m doing is trying to show one set of views if it has /Framed/controller/action and another set if it does not have /framed. I thought areas were the way to go, but maybe not.

  • 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-17T17:17:49+00:00Added an answer on May 17, 2026 at 5:17 pm

    All of our controllers implement the same base class, and we use the following override to do what you’re describing:

    protected override ViewResult View(string viewName, string masterName, object model)
    {
        if (masterName == null)
        {
            var options = PortalRequestManager.CurrentPortalRouteOptions;
            masterName = options.MvcMasterPath;
        }
        return base.View(viewName, masterName, model);
    }
    

    All of our AreaRegistrations use the following method to register their areas:

        public static void RegisterMvcAreaRoutes(AreaRegistrationContext context, string name, string url,
                                                 object defaults)
        {
            context.MapRoute(name + "Portal",
                             "P/Channel/" + url,
                             defaults);
            context.MapRoute(name + "FramePortal",
                             "F/Channel/" + url,
                             defaults);
        }
    

    And then the PortalRequestManager that you saw in the first code block parses the URL to see if it uses “/P” or “/F” to determine which MvcMasterPath to use.

    We use Ninject’s controller factory, which has no problem with this setup, so I can’t really speak to your problems with StructureMap.

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

Sidebar

Related Questions

I have created two master pages for my website. one for normal use, and
I have one master page which applies to all pages in this website. On
I have 2 master pages inside one ASP.Net website. It work fine without publishing
I have some .aspx pages with one master pages. I want to give client
I have two pages that inherit from one master page, First.aspx or second.aspx. Navigation
I have a one master Page. I want to add 3 Menu items to
In web programming you have one or more master pages and some content pages
I have an asp.net application with master page. In one of the pages I
I have a site with master pages and the only thing I want on
I have two pages. One aspx page and the other an aspx page but

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.