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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T13:12:25+00:00 2026-05-25T13:12:25+00:00

I have 2 controllers which are SearchController and SearchByStaffController respectively. They are very similar

  • 0

I have 2 controllers which are SearchController and SearchByStaffController respectively. They are very similar and both have an action with action name “Search”. When I call View(“Search”) in their common super class, the confusion comes. Only the “Search” view with SearchController is rendered.

  1. Does the MVC framework get only the first view that matches the name and ignore the rest?
  2. I tried to pass the view path in View() and it worked. Would there be any side effect for doing so? I searched over the web and seems no one has done this before.

Thanks!

  • 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-25T13:12:26+00:00Added an answer on May 25, 2026 at 1:12 pm
    Does the MVC framework get only the first view that matches the name and ignore the rest?
    

    Yes. The routing rules are aparsed (top to bottom) and when a rule is matched all end.

    I tried to pass the view path in View() and it worked. Would there be any side effect for doing so? I searched over the web and seems no one has done this before.
    

    You can but I don’t like that because MVC is based on conventions. So, I see forcing the path of the view a way to broke a convention. Are you sure you can’t simply create two routing rules for the two methods? So you can do something like this:

    return RedirectToAction("Search", "Controller1");
    

    and

    return RedirectToAction("Search", "Controller2");
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have two view controllers in a tabbar which can both edit data. Therefore,
I have a bunch of Rails 3.1 controllers which all have very similar testing
I have two controllers Project and Tag, both of which have a create view
I have an action in one of my controllers which creates a downloadable zip
I have two View Controllers: TableViewController (which is used as a modal view controller)
I have a UIPageViewController load with my Viewcontroller. The view controllers have buttons which
I have a Rails application with several models-views-controllers which have some similar characteristics, for
I have a view with two drop downlist which is used to search the
In my app there are numerous view controllers which have their own purposes. However,
I have a create action in one of my controllers which responds to ajax

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.