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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T17:33:06+00:00 2026-06-15T17:33:06+00:00

how can i remove the child action in asp.net mvc3. I mean i am

  • 0

how can i remove the child action in asp.net mvc3. I mean i am having partial views and main views. In the url bar when i entered the child page then it should not load.

for suppose my main page is

localhost:5820/Home/Index

Then when i enter

localhost:5820/Home/Index

then it should work and the child item is

localhost:5820/Home/About

Then when i enter

localhost:5820/Home/About

then it should not open. How can i do that in asp.net mvc. I have several pages like that i have displayed the pages in how can
i rectify this issue

  • 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-06-15T17:33:07+00:00Added an answer on June 15, 2026 at 5:33 pm

    The fact that your ABOUT page is a link inside your HOME page does not mean it is a child action, in fact, from the point of view of MVC they are in the same level, is YOU as a programmer that give the ilussion of hiereachies by providing an order of navigation.

    Now, what you can do is:

    1. simply remove the Action Methods from your controller, or

    2. write a simple ignore route like:

      routes.IgnoreRoute(“YourRuleToIgnoreActions”);

    this rules should be at the beginning of your RegisterRoutes method in RegisterRoutes to avoid other rules to be triggered

    To build up your ignore rules, here is a nice discussion on the topic: http://ardalis.com/IgnoreRoute-in-ASP.NET-Routing-is-Order-Dependent

    UPDATE:
    Probably too much thinking on this one, but in my opinion, the Models CAN have properties that modify the behaviour of the View, this is because from an architectural point of view, when you are already in the View, your concern is exclusively on the presentation layer, so I think it is perfectly valid to have something like:

     public class MyReportsModel{
         public bool displaySection1 { get; set;}
        //other data
     }
    

    and in your views, you can change the presentation in the following way:

      @{
       if(@Model.displaySection1){
            //display as normal
        }
    
    }
    

    Of course, when you populate the model you should set that property in each controller according to your needs:

      MyReporstModel thisView = new MyReportsModel();
      thisView.displaySection1 = true;
       // set all properties necessary to display
    
       // if the controller knows that this partial view won't be displayed then 
        thisView.displaySection1 = false;
    

    But that is no longer a technical issue but an architectural one.

    hope it helps,

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

Sidebar

Related Questions

Is there a way I can remove the background bar image in the SeekBar
I wonder if I can remove all added event handlers in all the child
Within my main Activity, I create a FrameLayout with child Views and set it
I have a master-child tables. User can add/remove childs after selecting the master item/entity.
we can remove formula from one cell by cell.setCellFormula(null) . but if i want
One can remove all calls to printf() using #define printf . What if I
How we can remove an array entry from : var a = [],b =
How to I can remove posts from a specific category from homepages in wordpress?
I am looking for an API that can remove bundle items added in a
I am wondering How i can remove a part if my string . For

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.