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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T11:42:13+00:00 2026-06-08T11:42:13+00:00

I have a view, on the top there’s a dropdownlist which basically allows user

  • 0

I have a view, on the top there’s a dropdownlist which basically allows user to select one of the two options.On now the basis of this selection i have to show the content on this page.

Now, what ‘d be the right way to go, i should create two partial views and put them in separate divs and on the basis of selection i’d make one of them visible

Or, just have two divs and have my chtml markup inside them and make one of them visible on the basis of user selection.

  • 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-08T11:42:15+00:00Added an answer on June 8, 2026 at 11:42 am

    If you want to use partial views, you could use ajax to load them into a single div containing the content instead of having them both already on the page and hidden.

    The jquery call to the controller would look like this:

    $("#form").submit(function() {
            $.ajax({
            type: 'POST',
            url: '@Url.Action("PartialViewMethod","ControllerName")',
            data: $(this).serialize(),
            success: function (data) {
                $("#contentDivId").html(data);
            },
            });
    }
    

    The controller method would look like this:

    public ActionResult PartialViewMethod (string PartialViewName) {
         return PartialView("_" + PartialViewName);
    }
    

    Assuming that this is wrapped in a form submitting the name of the partial view you want to return, this would load the html from the partial view into the div with the id contentDivId.

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

Sidebar

Related Questions

I have a view ( parent ) with two subviews, one on top (
I have a view which is composed of top, left and bottom headers and
I have a partial view which is displayed on the top right of every
i have view like 'home/details/5', it can be access by anonymous user. but there
There is apparently a bug in Android which breaks View.bringToFront . If I have
I have two views the top view has some opaque and some transparent regions
I have custom view in my application which can be scrolled by the user.
http://dl.dropbox.com/u/24856/android_issue.PNG i have a text view on top running into the relative layout with
I have a view with navigation bar control on the top. The view is
I have a UIViewController view as a subview/modal on top of another UIViewController view,

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.