I have the following jquery
- $(function () {
- $("#Asset").on("change", function () {
- var categoryId = $(this).val();
- $("#Equipment").empty();
- $("#Equipment").append("");
- $.getJSON(`?handler=Equipment&id=${categoryId}`, (data) => {
- $.each(data, function (i, item) {
- $("#Equipment").append(``);
- });
- $('#Equipment').selectpicker({ liveSearch: true });
- });
- $.getJSON(`?handler=AssetDetails&id=${categoryId}`, (data) => {
- if (!jQuery.isEmptyObject(data)) {
- $("#AssetID").val(data.assetID);
- $("#AssetName").val(data.assetName);
- $("#AssetManufacturer").val(data.assetManufacturer);
- }
- });
- });
- });
Select
- class="col-md-5">
- class="form-control" asp-items="@(new SelectList(string.Empty, "WOAId", "AssetID", "AssetName", "AssetManufacturer"))" data-style="border-warning bg-transparent">
- >--Select Asset--
How do I pass $("#AssetID").val(data.assetID); as id in button asp-route-id?



Sachin SinghPosted Feb 25, 2021, 4:53 PM
Marius VasilePosted Feb 26, 2021, 5:23 AM
Marius VasilePosted Feb 25, 2021, 5:54 PM
Marius VasilePosted Feb 25, 2021, 5:00 PM