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

  • Home
  • SEARCH
  • 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 7168899
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T14:52:32+00:00 2026-05-28T14:52:32+00:00

I have a portion of a table whose values depend on the value in

  • 0

I have a portion of a table whose values depend on the value in my dropdownlist. How can I update the the table when the selected option of the dropdownlist changes.

grid

@foreach (var choice in ViewData.Model.Options where choiceId == ViewData.Model.choiceLevelId)
                    {
                        <tr class='gridrow'>
                            <td>.....

dropdown

 <div class="editor-field">
                @Html.DropDownListFor(model => model.choiceLevelId,
                            (
                             ...
  • 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-28T14:52:33+00:00Added an answer on May 28, 2026 at 2:52 pm

    What table are you talking about? ASP.NET MVC has no knowledge of tables or chairs. It works with Models, Controllers and Views.

    So you have a View in which you have rendered a <select> box and you want upon changing the value of this select box by the user to invoke a Controller Action passing the newly selected value to the server so that it can perform some processing. Am I right?

    You will have to use javascript in your View in order to subscribe to the change event of this dropdown. Then you have a couple of possibilities:

    • Use an AJAX request to send the selected value to the server.
    • Redirect the current browser (using window.location.href) to the controller action passing it the selected value as action argument.

    Depending on your requirements you could pick the technique that suites best for you.

    Let me illustrate the first approach with an example using jQuery:

    <script type="text/javascript">
        $(function() {
            // subscribe to the .change event of the dropdowns
            $('select').change(function() {
                // fetch the newly selected value
                var selectedValue = $(this).val();
                // send it as an AJAX request to some controller action
                $.post('@Url.Action("Foo")', { value: selectedValue }, function(result) {
                    // this will be invoked in the case of success of the AJAX call
                    // TODO: do something with the results returned by the controller action
                });
            });
        });
    </script>
    

    and your controller action that will handle the AJAX request:

    [HttpPost]
    public ActionResult Foo(string value)
    {
        // this action will be invoked when the user changes the selection
        // in one of the dropdown lists and passed the newly selected value.
        // So using this new value you could perform the desired processing
        // on your model here and return a view. Since this action was invoked
        // with an AJAX call you could return a JSON string to the client indicating
        // the success or failure of whatever processing you were intending to perform 
        // here
    
        ...
    
    }
    

    UPDATE:

    If you wanted to submit the form containing the dropdowns when the selection changes you could use the following:

    <script type="text/javascript">
        $(function() {
            // subscribe to the .change event of the dropdowns
            $('select').change(function() {
                // trigger the submission of the containing form:
                $(this).closest('form').submit();
            });
        });
    </script>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I was wondering how I can pull down a portion of a table using
I have a situation where I want to associate multiple values from one table
I have the simplest table in the world, for looking up lat/lng values for
I have a portion of a bash script that is getting a filename without
Let's say we have a code portion like this: IProduct product = ProductCreator.CreateProduct(); //Factory
Basically my problem stems from a desire to have the textbox portion be white,
I have an html page i want to print a portion of this html
I have some standard-texts, but some portion of it is different. But of these
The problem: we have one application that has a portion which is used by
I am building a site that will (obvisouly) have a front end public portion

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.