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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T16:21:07+00:00 2026-05-30T16:21:07+00:00

I’m well versed in ASP.NET WebForms, and was considering switching my code to MVC

  • 0

I’m well versed in ASP.NET WebForms, and was considering switching my code to MVC 3.

I am learning MVC, and have some understanding in it, but, there’s one issue I haven’t come to understand yet.

It goes like this:

With WebForms code, I was able to have a DropDownList, that when selected, would’ve triggered a Button press through Javascript, and that button would’ve triggered a Method that would’ve populated another DropDown, but both DropDown’s were part of the same form, and the actual Button that is visible to the user (and is to be manually pressed by the user) triggers a Method that gets values from both those DropDowns as well as other fields.

The thing is, I don’t know how to do this with MVC. From my current understanding, if I wanted to send form data to the app, it has to follow a Model. That is what makes it so confusing to me (from my current understanding), how do I get the first DropDown to send only the data from inside the first DropDown? Also populating the other dropdown is a little bit of a foggy idea with MVC as well, but especially the point I made about the first DropDown is what makes me confused the most.

If anyone can help me in any way on this it would be greatly appreciated.

  • 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-30T16:21:08+00:00Added an answer on May 30, 2026 at 4:21 pm

    The big difference to get your head around here is that there are non of the old style postbacks in ASP.NET MVC.

    In this case, you get to be in control of how you obtain the new data for your dropdown box.

    When the form is complete and we’re ready to send the data to the server, we’ll be sending it back as a spcific type to our controller method but until that point, we can access the data we need from any other controller method.

    Personally I’d use jQuery to do this using an ajax request to a controller method that returns a JsonResult type.

    Something like:

    $.getJSON("/MyController/GetSecondDropdownValues", function(result) {
     $.each(result, function() {
        $('#mySecondDropdown').append($("<option />").val(this.Name));
    });
    

    C#

    public JsonResult GetSecondDropdownValues(string initialDropdownValue)
    {
       /* Do the work to obtain the values here */
       return Json(returnedValues);
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have just tried to save a simple *.rtf file with some websites and
I have a French site that I want to parse, but am running into
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I have an MVC Razor view @{ ViewBag.Title = Index; var c = (char)146;
I have this code to decode numeric html entities to the UTF8 equivalent character.
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I want to count how many characters a certain string has in PHP, but
For some reason, after submitting a string like this Jack’s Spindle from a text
I have a jquery bug and I've been looking for hours now, I can't
this is what i have right now Drawing an RSS feed into the php,

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.