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 SinghRank #66 · 26.2K reputationPosted Feb 25, 2021, 11:53 AM EST
Sachin SinghRank #66 · 26.2K reputationPosted Feb 24, 2021, 12:28 PM EST
Marius VasileRank #785 · 2.9K reputationPosted Feb 24, 2021, 12:38 PM EST
Sachin SinghRank #66 · 26.2K reputationPosted Feb 24, 2021, 12:41 PM EST
Kiran MohantyRank #821 · 2.8K reputationPosted Feb 25, 2021, 1:05 AM EST
Marius VasileRank #785 · 2.9K reputationPosted Feb 25, 2021, 10:51 AM EST
Marius VasileRank #785 · 2.9K reputationPosted Feb 25, 2021, 11:08 AM EST
Marius VasileRank #785 · 2.9K reputationPosted Feb 25, 2021, 12:00 PM EST