locked
Pass parameters through unobtrusive-ajax post RRS feed

  • Question

  • User1051638994 posted

    Hello!

    I have a form

     <form method="post" data-ajax="true" data-ajax-method="post"  asp-action="Requests" asp-controller="Home">
              
                        <select id="Records" class="form-control col-lg-12">
    
                            <option value="0" selected>--Choose---</option>
                            <option value="1">All records</option>
                            <option value="2">Per User</option>
                        </select>
    
                <input type="submit" value="Go" class="btn btn-success"/>
            </form>

    How can I pass the parameter to my controller from the dropdown ?

    Thank you

    Tuesday, November 17, 2020 1:14 PM

Answers

  • User-474980206 posted

    Give the select a name attribute. Only named form elements are posted.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Tuesday, November 17, 2020 3:31 PM

All replies

  • User-474980206 posted

    Give the select a name attribute. Only named form elements are posted.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Tuesday, November 17, 2020 3:31 PM
  • User1051638994 posted

    thank you it worked!

    Tuesday, November 17, 2020 4:06 PM