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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T07:37:00+00:00 2026-05-29T07:37:00+00:00

I’m a web developer new to using the MVC3 framework. We’re building a site

  • 0

I’m a web developer new to using the MVC3 framework. We’re building a site that implements a lot of sub folders for different segments of our audience. This routing concept is throwing a wrench in our structure for SEO.

In my global.asax file under the routing section we have:

routes.MapRoute("test", "test/{testFirst}/{testSecond}",
    new { controller = "test", action = "RouteTest", testSecond = UrlParameter.Optional });

and in my controller we have:

public ActionResult RouteTest(string testFirst, string testSecond)
{
    return View(testFirst, testSecond);
}

When I run the site and try to go to /test/test/index it won’t pull up the view. It’s stuck looking for test.cshtml which doesn’t exist because it’s a folder not a file.

Any ideas on to how make nested folders work?

EDIT:
Here’s a branch of the structure we want and maybe it will help with what I’m trying to accomplish.

This is kind of hard to show but it should get the idea across. We have 5 different audiences that come to the site. I broke down 1 audience and what the flow of that audience is.

Not all segments will have products some are just content other segments have that 3rd level and have products to view

audience

  • segment
  • segment
    • products
  • segment
    • products
  • segment

This is the basic structure that we want the URLs to take

domain.com/audience/segment/products/(productsname)

Suggestions on how to make this possible

  • 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-29T07:37:01+00:00Added an answer on May 29, 2026 at 7:37 am

    You are using the wrong overload for the View() method. Here’s what you’re using when you call View(testFirst, testSecond):

    protected internal ViewResult View(
        string viewName,
        string masterName
    )
    

    MSDN Reference.

    By putting “test” for the viewName, you’re telling the Controller to render a View called Test (test.cshtml). Which you don’t have.

    It sounds to me like you are trying to correlate WebForms with MVC. It is not the same, and you are seeing a prime example with routing. ASP.NET MVC doesn’t work off of the NTFS structure (folders and files). It relies on routing through route definitions.

    If you are looking to render the View “RouteTest”, then do something like this:

    public ActionResult RouteTest(string testFirst, string testSecond)
    {
        ViewBag.testFirst = testFirst;
        ViewBag.testSecond = testSecond;
    
        return View();
    }
    

    This will render the “RouteTest” view and in your dynamic object ViewBag you will have access to two properties: testFirst and testSecond. In your view you can pull those values. (Although I highly recommend strongly-typed Views using a ViewModel)

    Example Solution

    ViewModel

    public class TestData
    {
        public string testFirst { get ; set ; }
        public string testSecond { get ; set ; }
    }
    

    Controller

    public ActionResult RouteTest(string testFirst, string testSecond)
    {
        TestData td = new TestData();
        td.testFirst = testFirst;
        td.testSecond = testSecond;
    
        return View(td);
    }
    

    Strongly-Typed View

    @model TestData
    
    @Html.Label(Model.testFirst)
    @Html.Label(Model.testSecond)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have a French site that I want to parse, but am running into
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
We're building an app, our first using Rails 3, and we're having to build
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I've got a string that has curly quotes in it. I'd like to replace
Seemingly simple, but I cannot find anything relevant on the web. What is the
I want use html5's new tag to play a wav file (currently only supported
I'm using v2.0 of ClassTextile.php, with the following call: $testimonial_text = $textile->TextileRestricted($_POST['testimonial']); ... and
We are using XSLT to translate a RIXML file to XML. Our RIXML contains

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.