Microsoft为实现Ajax功能而开发的一组ASP.NET扩展。
ASP.NET Core MVC 电子商务使用 Ajax 过滤产品、品牌名称、类别
这里是产品过滤前端 HTML 代码: 过滤侧边栏 这是产品过滤前端 HTML 代码: 过滤侧边栏 <div class="widget widget-collapsible"> <h3 class="widget-title"> <a data-toggle="collapse" href="#widget-4" role="button" aria-expanded="true" aria-controls="widget-4"> Brands </a> </h3><!-- End .widget-title --> <div class="collapse show" id="widget-4"> <div class="widget-body"> <div id="brand-filter" name="brand-filter" class="brand-filter"> @foreach (var brand in ViewBag.brandlist as List<Brand>) { <div id="brand-filter" class="filter-item"> <div class="custom-control custom-checkbox"> <input type="checkbox" class="custom-control-input brand-checkbox" id="@brand.id" value="@brand.id" name="custom-control-input"> <label class="custom-control-label" for="@brand.id"> @brand.name </label> </div><!-- End .custom-checkbox --> </div> <!-- End .filter-item --> } </div><!-- End .brand-filter --> </div><!-- End .widget-body --> </div><!-- End .collapse --> </div><!-- End .widget --> 我正在使用 EF Core 从 SQL 数据库中获取品牌列表和类别。 这是我的 AJAX 代码: <script src="https://code.jquery.com/jquery-3.6.0.min.js"></script> <script> const formatCurrency = (value) => new Intl.NumberFormat('tr-TR', { minimumFractionDigits: 2, maximumFractionDigits: 2 }).format(value) + ' TL'; const loadProducts = () => { // Gather filter values const category = $('#category-filter').val(); // Collect all checked brand checkboxes const brands = $('brand-filter input.custom-control-input:checked').map((_, el) => $(el).val()).get(); const sortby = $('#sortby-filter').val(); // Send AJAX request $.ajax({ url: '/urun/Filter', // Update this with the actual filtering endpoint method: 'GET', data: { category, brands: brands.join(','), sortby }, // Send brands as a comma-separated string success: (data) => { const productContainer = $('#product-list').empty(); if (data.length) { data.forEach((product) => { const addToCartUrl = `@Url.Action("AddToCart", "Home")?productId=${product.id}`; const loginUrl = '/Login/Index'; productContainer.append(` <div class="product-item col-6 col-md-4 col-lg-3"> <div class="product product-4"> <figure class="product-media"> <a href="/urun/${product.slug}"> <img src="${product.image}" alt="${product.name}" class="product-image"> </a> <div class="product-action-vertical"> ${product.a == 0 ? ` <a href="${loginUrl}" class="btn-product-icon btn-cart btn-expandable"><span>Sepete Ekle</span></a> ` : ` <a href="${addToCartUrl}" class="btn-product-icon btn-cart btn-expandable"><span>Sepete Ekle</span></a> `} </div> </figure> <div class="product-body"> <h3 class="product-title"> <a href="/urun/${product.slug}"> <span><a style="color:#015fc9" href="brand.html">${product.brandname}</a></span> ${product.name} </a> </h3> <div class="product-price"> ${product.indirimvarmı ? ` <span class="new-price">${formatCurrency(product.indirimliFiyat)}</span> <span class="old-price">Eski Fiyat: ${formatCurrency(product.price)}</span> ` : ` <div class="price">${formatCurrency(product.price)}</div> `} </div> <div class="product-action"> ${product.user == 1 ? ` <a href="${loginUrl}" class="btn-product btn-cart"><span>Sepete Ekle</span></a> ` : ` <a href="${addToCartUrl}" class="btn-product btn-cart"><span>Sepete Ekle</span></a> `} </div> </div> </div> </div> `); }); } else { productContainer.append('<p>No products found.</p>'); } }, error: () => alert('Ürünler yüklenirken bir hata oluştu.') }); } // Event bindings $('#category-filter, #sortby-filter').on('change', loadProducts); $(document).on('change', '.brand-checkbox', loadProducts); // Initial load $(document).ready(loadProducts); </script> 类别过滤器 UI HTML 标记: <div class="widget widget-collapsible"> <h3 class="widget-title"> <a data-toggle="collapse" href="#widget-1" role="button" aria-expanded="true" aria-controls="widget-1"> Category </a> </h3><!-- End .widget-title --> <div class="collapse show" id="widget-1"> <div class="widget-body"> <div class="filter-items filter-items-count"> @foreach (var category in ViewBag.categories as List<Category>) { <div class="filter-item"> <div class="custom-control custom-checkbox"> <input type="checkbox" class="custom-control-input" id="[email protected]"> <label class="custom-control-label" for="[email protected]">@category.categoryname</label> </div><!-- End .custom-checkbox --> </div><!-- End .filter-item --> } </div><!-- End .filter-items --> </div><!-- End .widget-body --> </div><!-- End .collapse --> ```` Sortby 过滤器工作正常,但在品牌上,带有复选框的类别过滤器不起作用。我认为我对复选框 ID 和名称有疑问。请帮助我。 我可以编码选择 1 个过滤器项目并完美运行,但我想使用多个类别和品牌进行过滤。 根据客户端调用,您正在传递单个类别并尝试发送多个品牌: data: { category, brands: brands.join(','), sortby } 通过尝试字符串join,您的API端点将需要接受“品牌”作为string,而不是数组/列表。您可能想发布您的服务器端方法签名,但 Join 可能是不必要的: data: { category, brands: brands, sortby } public IActionResult Filter(int category, [FromQuery(Name = "brands")] int[] brands, string sortby) GET 请求期望查询字符串上的参数,但我相信复杂类型默认是从请求正文中期望的。可能需要 [FromQuery] 来确保这一点。如果您选择 2 个品牌(Id #1 和 #2),您的查询字符串应类似于“...&brands=1&brands=2...”使用带有 Join 的逗号分隔字符串也应该有效,但您需要从服务器端解析 ID: public IActionResult Filter(int category, string brands, string sortby) { var brandIds = brands.Split(',', StringSplitOptions.RemoveEmptyEntries) .Select(x => int.Parse(x)) .ToList(); 假设 ID 为 int。这将需要额外的防护/错误处理,以应对出现不良数据的任何意外情况。 除此之外,请考虑修改您的问题,详细说明您在调试过程中看到的内容,例如是否到达过滤器端点,或者到达时是否缺少预期参数等,而不是简单地“它不起作用”。在描述问题时,最好用“我期望看到什么”和“我实际看到什么”来表达。
加载时展开 Telerik RadTreeView(适用于 ASP.net AJAX)
我想知道为什么我找不到一种直接的方法来在页面加载时展开静态 RadTreeView 的所有节点。我首先从 Visual Studio 的属性窗格中遍历了它的所有属性,并且我还查...
首先我想说,虽然这是我第一次在这里发帖,但这些版块对我帮助很大。 话虽如此,我遇到了一个关于 AJAX 和脚本的奇怪问题。 你看,在...
我已经在 AJAX 方面工作了几个月,我看到 Ajax 请求如下, 向后台页面传递参数(PHP/ASP/HTML/TXT/XML...这里还能有什么?) 在服务器上做一些处理 ...
我想通过Ajax函数通过id commentList将数据加载到div中。我需要使用 Ajax 通过表单标记将数据发送到名为 CreateComment 的操作。创建评论后,我需要加载数据...
如何在 ASP.NET Web 表单应用程序中进行 AJAX 调用后显示成功或失败消息
我正在开发一个用 VB.Net 编写的 ASP.NET Webforms 项目。我想使用 Ajax 在后台代码中调用 Web 方法。按钮单击事件正确调用代码隐藏方法。然而
我有一个带有 DataList 的用户控件。我希望列表仅显示前 20 条记录,底部有一个“更多”链接。如果用户点击更多,则异步加载下面20多条记录...
我正在尝试使用 MVC4.Paging nuget 包实现 ASP.NET MVC 分页。 问题: 它可以在在线演示中运行,也可以在下载源代码中运行。但我无法找到为什么它不是
我正在尝试在asp.net中找到解决方案以实现数据分页,所以 1) 应用程序不必在每个页面索引更改时连接到数据库,以便检索整个集合或部分...
我正在一个项目中使用 ASP.NET MVC,并且我有一个数据表,该数据表在页面加载时工作正常,但是当我提交表单进行搜索时,它会返回正确的 json 响应,但事实并非如此
ASP .NET 6。托管在 Azure 上。 GetAllVehicles() Ajax 调用在 Visual Studio 2022 中有效,但在 Azure 上出错
$(文档).ready(函数() { $('#vehiclesTable').DataTable({ “处理”:真实, “服务器端&qu...</desc> <question vote="0"> <pre><code><script type="text/javascript"> $(document).ready(function () { $('#vehiclesTable').DataTable({ "processing": true, "serverSide": true, "ajax": { "url": "@Url.Action("GetAllVehicles", "Vehicles")", "type": "GET", "error": function (xhr, error, thrown) { console.log("Error: ", xhr.responseText); } }, "columns": [ { "data": "customerName" }, { "data": "year" }, { "data": "make" }, { "data": "model" }, { "data": "trim" }, { "data": "engineSize" }, { "data": "transmission" }, { "data": "transmissionType" }, { "data": "mileage" }, { "data": "id", "render": function (data, type, row) { return `<a href="/Vehicles/Details/${data}" class="btn btn-info">Details</a> <a href="/Vehicles/Edit/${data}" class="btn btn-warning">Edit</a> <a href="/Vehicles/Delete/${data}" class="btn btn-danger">Delete</a>`; }, "orderable": false } ], "order": [[0, "asc"]] }); }); </script> <- script in index.html [HttpGet] public async Task<IActionResult> GetAllVehicles() { var draw = HttpContext.Request.Query["draw"].FirstOrDefault(); var start = Request.Query["start"].FirstOrDefault(); var length = Request.Query["length"].FirstOrDefault(); var sortColumn = Request.Query["columns[" + Request.Query["order[0][column]"].FirstOrDefault() + "][data]"].FirstOrDefault(); var sortColumnDirection = Request.Query["order[0][dir]"].FirstOrDefault(); var searchValue = Request.Query["search[value]"].FirstOrDefault(); int pageSize = length != null ? Convert.ToInt32(length) : 0; int skip = start != null ? Convert.ToInt32(start) : 0; int recordsTotal = 0; // Fetch all data var vehiclesData = _context.Vehicles .Include(j => j.Customer) .Select(j => new { j.Id, CustomerName = j.Customer.FirstName + " " + j.Customer.LastName, j.Year, j.Make, j.Model, j.Trim, j.EngineSize, j.Transmission, j.TransmissionType, j.Mileage }); // Search if (!string.IsNullOrEmpty(searchValue)) { vehiclesData = vehiclesData.Where(j => j.CustomerName.Contains(searchValue) || j.Year.ToString().Contains(searchValue) || j.Make.Contains(searchValue) || j.Model.Contains(searchValue) || j.Trim.Contains(searchValue) || j.EngineSize.Contains(searchValue) || j.Transmission.Contains(searchValue) || j.TransmissionType.Contains(searchValue) || j.Mileage.Contains(searchValue) ); } // Sorting if (!(string.IsNullOrEmpty(sortColumn) && string.IsNullOrEmpty(sortColumnDirection))) { var sortExpression = $"{sortColumn} {sortColumnDirection}"; vehiclesData = vehiclesData.OrderBy(sortExpression); } // Total number of rows count recordsTotal = vehiclesData.Count(); // Paging var data = vehiclesData.Skip(skip).Take(pageSize).ToList(); // Returning Json Data var jsonData = new { draw = draw, recordsFiltered = recordsTotal, recordsTotal = recordsTotal, data = data.Select(v => new { customerName = v.CustomerName, year = v.Year, make = v.Make, model = v.Model, trim = v.Trim, engineSize = v.EngineSize, transmission = v.Transmission, transmissionType = v.TransmissionType, mileage = v.Mileage, id = v.Id }) }; return Ok(jsonData); } </code></pre> <p><- VehiclesController GetAllVehicles()</p> <p>当我在本地运行它时,效果非常好。当我将其推送到 Azure 时,它就崩溃了。</p> <p>我尝试了不同的调用、路由,每个更改都在本地工作,但在推送到 Azure 时就崩溃了。我有另一个控制器,它的调用几乎相同,只是数据不同,并且工作完美。</p> </question> <answer tick="false" vote="0"> <p>使用当前代码,网址如下:</p> <p><strong>本地:</strong></p> <pre><code>https://localhost:port/Vehicles/GetAllVehicles?draw=1&columns%5B0%5D%5Bdata%5D=customerName&columns%5B0%5D%5Bname%5D=&columns%5B0%5D%5Bsearchable%5D=true&columns%5B0%5D%5Borderable%5D=true&columns%5B0%5D%5Bsearch%5D%5Bvalue%5D=&columns%5B0%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B1%5D%5Bdata%5D=year&columns%5B1%5D%5Bname%5D=&columns%5B1%5D%5Bsearchable%5D=true&columns%5B1%5D%5Borderable%5D=true&columns%5B1%5D%5Bsearch%5D%5Bvalue%5D=&columns%5B1%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B2%5D%5Bdata%5D=make&columns%5B2%5D%5Bname%5D=&columns%5B2%5D%5Bsearchable%5D=true&columns%5B2%5D%5Borderable%5D=true&columns%5B2%5D%5Bsearch%5D%5Bvalue%5D=&columns%5B2%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B3%5D%5Bdata%5D=model&columns%5B3%5D%5Bname%5D=&columns%5B3%5D%5Bsearchable%5D=true&columns%5B3%5D%5Borderable%5D=true&columns%5B3%5D%5Bsearch%5D%5Bvalue%5D=&columns%5B3%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B4%5D%5Bdata%5D=trim&columns%5B4%5D%5Bname%5D=&columns%5B4%5D%5Bsearchable%5D=true&columns%5B4%5D%5Borderable%5D=true&columns%5B4%5D%5Bsearch%5D%5Bvalue%5D=&columns%5B4%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B5%5D%5Bdata%5D=engineSize&columns%5B5%5D%5Bname%5D=&columns%5B5%5D%5Bsearchable%5D=true&columns%5B5%5D%5Borderable%5D=true&columns%5B5%5D%5Bsearch%5D%5Bvalue%5D=&columns%5B5%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B6%5D%5Bdata%5D=transmission&columns%5B6%5D%5Bname%5D=&columns%5B6%5D%5Bsearchable%5D=true&columns%5B6%5D%5Borderable%5D=true&columns%5B6%5D%5Bsearch%5D%5Bvalue%5D=&columns%5B6%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B7%5D%5Bdata%5D=transmissionType&columns%5B7%5D%5Bname%5D=&columns%5B7%5D%5Bsearchable%5D=true&columns%5B7%5D%5Borderable%5D=true&columns%5B7%5D%5Bsearch%5D%5Bvalue%5D=&columns%5B7%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B8%5D%5Bdata%5D=mileage&columns%5B8%5D%5Bname%5D=&columns%5B8%5D%5Bsearchable%5D=true&columns%5B8%5D%5Borderable%5D=true&columns%5B8%5D%5Bsearch%5D%5Bvalue%5D=&columns%5B8%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B9%5D%5Bdata%5D=id&columns%5B9%5D%5Bname%5D=&columns%5B9%5D%5Bsearchable%5D=true&columns%5B9%5D%5Borderable%5D=false&columns%5B9%5D%5Bsearch%5D%5Bvalue%5D=&columns%5B9%5D%5Bsearch%5D%5Bregex%5D=false&order%5B0%5D%5Bcolumn%5D=0&order%5B0%5D%5Bdir%5D=asc&start=0&length=10&search%5Bvalue%5D=&search%5Bregex%5D=false&_=1724050584463 </code></pre> <p><strong>在蔚蓝中</strong></p> <pre><code>https://webapplication220240628111356.azurewebsites.net/Vehicles/GetAllVehicles?draw=1&columns%5B0%5D%5Bdata%5D=customerName&columns%5B0%5D%5Bname%5D=&columns%5B0%5D%5Bsearchable%5D=true&columns%5B0%5D%5Borderable%5D=true&columns%5B0%5D%5Bsearch%5D%5Bvalue%5D=&columns%5B0%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B1%5D%5Bdata%5D=year&columns%5B1%5D%5Bname%5D=&columns%5B1%5D%5Bsearchable%5D=true&columns%5B1%5D%5Borderable%5D=true&columns%5B1%5D%5Bsearch%5D%5Bvalue%5D=&columns%5B1%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B2%5D%5Bdata%5D=make&columns%5B2%5D%5Bname%5D=&columns%5B2%5D%5Bsearchable%5D=true&columns%5B2%5D%5Borderable%5D=true&columns%5B2%5D%5Bsearch%5D%5Bvalue%5D=&columns%5B2%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B3%5D%5Bdata%5D=model&columns%5B3%5D%5Bname%5D=&columns%5B3%5D%5Bsearchable%5D=true&columns%5B3%5D%5Borderable%5D=true&columns%5B3%5D%5Bsearch%5D%5Bvalue%5D=&columns%5B3%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B4%5D%5Bdata%5D=trim&columns%5B4%5D%5Bname%5D=&columns%5B4%5D%5Bsearchable%5D=true&columns%5B4%5D%5Borderable%5D=true&columns%5B4%5D%5Bsearch%5D%5Bvalue%5D=&columns%5B4%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B5%5D%5Bdata%5D=engineSize&columns%5B5%5D%5Bname%5D=&columns%5B5%5D%5Bsearchable%5D=true&columns%5B5%5D%5Borderable%5D=true&columns%5B5%5D%5Bsearch%5D%5Bvalue%5D=&columns%5B5%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B6%5D%5Bdata%5D=transmission&columns%5B6%5D%5Bname%5D=&columns%5B6%5D%5Bsearchable%5D=true&columns%5B6%5D%5Borderable%5D=true&columns%5B6%5D%5Bsearch%5D%5Bvalue%5D=&columns%5B6%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B7%5D%5Bdata%5D=transmissionType&columns%5B7%5D%5Bname%5D=&columns%5B7%5D%5Bsearchable%5D=true&columns%5B7%5D%5Borderable%5D=true&columns%5B7%5D%5Bsearch%5D%5Bvalue%5D=&columns%5B7%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B8%5D%5Bdata%5D=mileage&columns%5B8%5D%5Bname%5D=&columns%5B8%5D%5Bsearchable%5D=true&columns%5B8%5D%5Borderable%5D=true&columns%5B8%5D%5Bsearch%5D%5Bvalue%5D=&columns%5B8%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B9%5D%5Bdata%5D=id&columns%5B9%5D%5Bname%5D=&columns%5B9%5D%5Bsearchable%5D=true&columns%5B9%5D%5Borderable%5D=false&columns%5B9%5D%5Bsearch%5D%5Bvalue%5D=&columns%5B9%5D%5Bsearch%5D%5Bregex%5D=false&order%5B0%5D%5Bcolumn%5D=0&order%5B0%5D%5Bdir%5D=asc&start=0&length=10&search%5Bvalue%5D=&search%5Bregex%5D=false&_=1724050584463 </code></pre> <h3>问题似乎无法解码 url。我已经使用decodeURIComponent尝试了下面的代码,效果很好。</h3> <pre><code>@{ ViewData["Title"] = "Vehicles List"; } <h2>Vehicles List</h2> <table id="vehiclesTable" class="table table-striped table-bordered"> <thead> <tr> <th>Customer Name</th> <th>Year</th> <th>Make</th> <th>Model</th> <th>Trim</th> <th>Engine Size</th> <th>Transmission</th> <th>Transmission Type</th> <th>Mileage</th> <th>Actions</th> </tr> </thead> <tbody> </tbody> </table> @section Scripts { <script src="https://cdn.datatables.net/1.11.3/js/jquery.dataTables.min.js"></script> <script src="https://cdn.datatables.net/1.11.3/js/dataTables.bootstrap4.min.js"></script> <script type="text/javascript"> $(document).ready(function () { $('#vehiclesTable').DataTable({ "processing": true, "serverSide": true, "ajax": { "url": decodeURIComponent("@Url.Action("GetAllVehicles", "Vehicles")"), "type": "GET", "data": function (d) { var queryParams = $.param(d); return decodeURIComponent(queryParams); }, "error": function (xhr, error, thrown) { console.log("Error: ", xhr.responseText); } }, "columns": [ { "data": "customerName" }, { "data": "year" }, { "data": "make" }, { "data": "model" }, { "data": "trim" }, { "data": "engineSize" }, { "data": "transmission" }, { "data": "transmissionType" }, { "data": "mileage" }, { "data": "id", "render": function (data, type, row) { return `<a href="/Vehicles/Details/${data}" class="btn btn-info">Details</a> <a href="/Vehicles/Edit/${data}" class="btn btn-warning">Edit</a> <a href="/Vehicles/Delete/${data}" class="btn btn-danger">Delete</a>`; }, "orderable": false } ], "order": [[0, "asc"]] }); }); </script> </script> } </code></pre> <p>那么网址将是</p> <pre><code>https://webapplication220240628111356.azurewebsites.net/Vehicles/GetAllVehicles?draw=1&columns[0][data]=customerName&columns[0][name]=&columns[0][searchable]=true&columns[0][orderable]=true&columns[0][search][value]=&columns[0][search][regex]=false&columns[1][data]=year&columns[1][name]=&columns[1][searchable]=true&columns[1][orderable]=true&columns[1][search][value]=&columns[1][search][regex]=false&columns[2][data]=make&columns[2][name]=&columns[2][searchable]=true&columns[2][orderable]=true&columns[2][search][value]=&columns[2][search][regex]=false&columns[3][data]=model&columns[3][name]=&columns[3][searchable]=true&columns[3][orderable]=true&columns[3][search][value]=&columns[3][search][regex]=false&columns[4][data]=trim&columns[4][name]=&columns[4][searchable]=true&columns[4][orderable]=true&columns[4][search][value]=&columns[4][search][regex]=false&columns[5][data]=engineSize&columns[5][name]=&columns[5][searchable]=true&columns[5][orderable]=true&columns[5][search][value]=&columns[5][search][regex]=false&columns[6][data]=transmission&columns[6][name]=&columns[6][searchable]=true&columns[6][orderable]=true&columns[6][search][value]=&columns[6][search][regex]=false&columns[7][data]=transmissionType&columns[7][name]=&columns[7][searchable]=true&columns[7][orderable]=true&columns[7][search][value]=&columns[7][search][regex]=false&columns[8][data]=mileage&columns[8][name]=&columns[8][searchable]=true&columns[8][orderable]=true&columns[8][search][value]=&columns[8][search][regex]=false&columns[9][data]=id&columns[9][name]=&columns[9][searchable]=true&columns[9][orderable]=false&columns[9][search][value]=&columns[9][search][regex]=false&order[0][column]=0&order[0][dir]=asc&start=0&length=10&search[value]=&search[regex]=false&_=1724051493112 </code></pre> <p>并且效果很好。这是测试结果。</p> <p><a href="https://i.sstatic.net/JpIMkaS2.png" rel="nofollow noreferrer"><img src="https://cdn.txt58.com/i/AWkuc3N0YXRpYy5uZXQvSnBJTWthUzIucG5n" alt="enter image description here"/></a></p> </answer> </body></html>
用于 jwt 身份验证的 Ajax 授权标头或 http cookie
将 Jwt 令牌传递给 ajax 请求调用的最佳且安全的方法是什么。 我有两个选择 选项 1. 在 ajax 标头中传递 jet 令牌,如下所示,但 Jwt 令牌在客户端响应中可见。 $.ajax({ ...
***我试图成功地将列表从控制器传递到ajax。它是来自 ajax 的 post 请求。 *** 当我尝试时,它出现为[模型模型] *这是我的控制器 公共 JsonResult CreatePackage(st...
我一直在尝试开发一个具有登录系统的网站。 作为其中的一部分,我想对服务器进行 AJAX 调用,以使用用户名和密码处理登录系统。 当我进行校准时...
AJAX asp:UpdatePanel 与 asp:Timer 从不刷新
我想我应该尝试一下计时器和更新面板。我有一个简单的页面,其中放置了 updatepanel 控件、标签和计时器。 “TICK”代码用当前更新标签...
希望你能帮助我解决这个问题。我正在尝试使用 AJAX 和 VB.NET 从服务器端获取列表到 javascript。我尝试了几件事,但它总是返回完整的文件而不是 l...
我遇到了一个问题,即我的 AJAX 调用无法到达 ASP.NET Core 应用程序中的控制器方法。尽管设置了 AJAX 调用和控制器方法,我还是收到了 404 错误。 ...
我想在用户单击该州时以模式形式显示每个州的城市列表。不幸的是,无论我做什么,我都无法解决这个问题。我将展示 ASP.NET Core 合作...
无法从 ASP.NET Core MVC 中的 Ajax 获取控制器中的数据
我正在尝试将数据从视图传递到我的控制器。我在 Ajax 中正确获取了值,但无法将它们传递给控制器。我在控制器中得到的注释始终为空。 阿贾...