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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T18:12:50+00:00 2026-05-17T18:12:50+00:00

Ive got a dropdown on one of my views. This dropdown only has for

  • 0

Ive got a dropdown on one of my views. This dropdown only has for entries. Basically i need to know how to call an action when the dropdown value is changed?

My situation is: Im making a simple inbox page. The dropdown has the filter options: View All, View Invites, View Replies etc..

When the user selects a filter option from the dropdown I want to call to an action to return the new view with the filtered data.

Any ideas? Im guessing it is somehow going to be a script attached to the OnChange of the dropdown, but i wouldnt have a clue what the syntax is or how call MVC action from the script.

Thanks in advance

  • 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-17T18:12:50+00:00Added an answer on May 17, 2026 at 6:12 pm

    You need to use javascript for this. Here’s an example. Suppose you have the following view model:

    public class MyViewModel
    {
        public IEnumerable<SelectListItem> Values { get; set; }
    }
    

    which you would populate in your controller:

    [HandleError]
    public class HomeController : Controller
    {
        public ActionResult Index()
        {
            var model = new MyViewModel
            {
                Values = new[] 
                {
                    new Item { Value = "1", Text = "Item 1" },
                    new Item { Value = "2", Text = "Item 2" },
                    new Item { Value = "3", Text = "Item 3" }
                }
            };
            return View(model);
        }
    }
    

    And then the view which is strongly typed to this model:

    <%: Html.DropDownListFor(x => x.SelectedValue, 
        new SelectList(Model.Values, "Value", "Text"), 
        new { id = "items" }
    )%>
    

    The last part is to register for the change event (using jquery in this example):

    $(function () {
        // Register for the change event of the drop down
        $('#items').change(function () {
            // When the value changes, get send an AJAX request to the
            // Filter action passing the selected value and update the
            // contents of some result div with the partial html returned
            // by the controller action
            $('#result').load('<%: Url.Action("filter") %>', 
                { selectedValue: $(this).val() }
            );
        });
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

ive got 2 dropdown menu that retrieve the file from the database. but it
I know that this has been asked a million times before, but nothing that
I've got a dropdown list that is being populated via a webservice using ASP>NET
this is my problem i,ve to create a dropdown list box from a table
I've got a a left floated UL list for a menu, one option with
I've got a value type called Product Type that is assigned to a product.
I've got a PHP-driven site that has a recordkeeping form. The user chooses a
My question is similar to this one but I'm having some problems with the
Ive got a button in a UICell. I want a list(a table view like
I've got an order details form in Silverlight that has a listbox of order

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.