How to get the value of “<select></select>” from a view into a Controller's “ActionResult”?

How to get the value of “<select></select>” from a view into a Controller's “ActionResult”?

I have a tag and a button. On click of the button, an actionResult in a controller is called. Like this.

I have a tag and a button. On click of the button, an actionResult in a controller is called. Like this.

<button type="button" onclick="location.href='@Url.Action("GetAllItems", "Items")'">Get Items</button>

And here's the ActionResult

public ActionResult GetAllItems() {
        string selectedItem = string.Empty;
        ItemsRepository itemsRepository = new ItemsRepository();
        ModelState.Clear();
        return View(itemsRepository.GetAllItems());
    }

selectedItem is the variable I want to store either the selectedText or the selectedValue. But I don't know how to.

This is the <Select> tag.

<select style="width:170px" id="ItemsID" name="Items"></select>

And this is the rough function to get the different results from onChange event.

<script>
$(document).ready(function () {
    $("#ItemsID").change(function () {
        var a = $('#ItemsID option:selected').val();
        var b = $('#ItemsID option:selected').text().trim();
        var c = $('#ItemsID option:selected').index();

    alert(a);
    alert(b);
    alert(c);
})

});

Please help.

Angular 9 Tutorial: Learn to Build a CRUD Angular App Quickly

What's new in Bootstrap 5 and when Bootstrap 5 release date?

Brave, Chrome, Firefox, Opera or Edge: Which is Better and Faster?

How to Build Progressive Web Apps (PWA) using Angular 9

What is new features in Javascript ES2020 ECMAScript 2020

Jquery from validation || ASP NET Core client side validation

LIKE | COMMENT | SHARE | SUBSCRIBE In this video, I will show you how to add form validation using jquery. Subscribe & Stay Connected! Thank You! ♥ #Identity...

How to implement JWT Authentication in ASP.NET Core 3.0 API with C#

In this tutorial we'll go through a simple example of how to implement JWT (JSON Web Token) authentication in an ASP.NET Core 3.0 API with C#

ASP.NET MVC Application with JQuery, AJAX

Let's have a sample example: We have a submit button in our JQuery AJAX MVC application. Let's try to show a message when it is clicked. ASP.NET MVC Application - Using JQuery, AJAX