asp.net-ajax

Popup extender “frozen” on code-behind exception

时光毁灭记忆、已成空白 提交于 2019-12-12 01:14:19
问题 In a C#/ASP.NET project, we're using an ajax modalpopupextender to display a "Processing..." message to the users. We're displaying it using a Javascript call in the code of the ASP.NET page. Then, in the code behind, we're doing some database operation, and hide again the popup using "popup.hide();" The problem is that when an exception occurs in the code behind, the popup is still displayed and the application does not handle errors as per the "customErrors" tag of the web.config. Any idea

Why isn't my viewmodel updating?

别说谁变了你拦得住时间么 提交于 2019-12-11 20:59:58
问题 I'm loading a partial view in my C#/MVC4 application with the intents of updating the model with the basics of a shopping cart. The partial view updates, but when I select the next item and submit, the viewmodel doesn't contain the data that was pushed the first time. I have a class to store the data: public class Selection { public class AllItems _AllItems { get; set; } public int nCounter { get; set; } public class Resource _Resource { get; set; } } My main view has this ajax form to post

How to get click event using Jquery when control is in UpdatePanel in asp.net?

冷暖自知 提交于 2019-12-11 19:41:36
问题 I have three div div1,div2div3 containing DataList control in each div . When i click on item in DataList1 then DataList2 will be loaded asynchronously which in UpdatePanel of div2 . Problem: When i click on control in DataList2 and try to access the Clicked Control Class using jquery it wont fire the Click event. Any idea? Sample output: Jquery Script: $('.imgOpaLevel2').click(function() { alert("hi"); //not able to get this message when clicked on DataList2 in div2 which is in updatepanel }

Trigger a asp.net event from a control placed outside the update panel

社会主义新天地 提交于 2019-12-11 19:37:59
问题 I have a very trick situation . i have some check boxes which used as filter for a repeater, and the check boxes are placed inside a jquery accordion , problem arises when i use a ajx update panel the jquery accordion stop working. i want the filtering to be done through async postback. so what i have done is i have placed the repeater inside the update panel. now i want to use the postback option of checkboxes which are placed outside of the update panel to trigger there respective events

Possible to load ASCX with jQuery.load() function?

风格不统一 提交于 2019-12-11 19:14:35
问题 Is it possible without encapsulating these controls in aspx files? The Register tag makes me think that it is not. 回答1: You can't call ascx page directly, they can't serve any html without added to aspx or render then dynamically in response to any page/handler. 回答2: One possible way would be to have a generic aspx stub page that acts as a host to the ascx in the normal web forms way make a callback to the that page using JQuery's $.ajax() method with some arguments to denote what ascx

Value not passing from view to controller using ajax

心不动则不痛 提交于 2019-12-11 18:56:09
问题 I am trying to pass a value across to my controller using ajax. ajax code as follows: var myId = $(".slectOne[checked]").attr("data-id"); $.ajax({ url: '@Url.Action("reservation_step_1", "Home")', type: 'POST', data: { id: myId }, }); controller code as follows: [HttpPost] [AllowAnonymous] public ActionResult reservation_step_1(string id) { string val = id; return RedirectToAction("reservation_step_2", "Home", new { val = val }); } I am unsure if I am doing anything wrong but my "id" value is

get the select element in .NET using AJAX

我的未来我决定 提交于 2019-12-11 18:49:30
问题 I have ajax function like this to run on HTML select list $.ajax({ type: "POST", url: urlemp, success: function (returndata) { if (returndata.ok) { // var data = eval("" + returndata.data + ""); select.empty(); select.append($('<option>' + "" + '</option>')); $.each(returndata.data, function (rec) { select.append($('<option>' + returndata.data[rec].Name + '</option>')); }); select.show('slow'); select.change(); } else { window.alert(' error : ' + returndata.message); } } } ); and this is the

Where can I get MicrosoftAjax.js

倖福魔咒の 提交于 2019-12-11 17:52:12
问题 My website has to run behind a reverse proxy in production. This causes a problem with the path to the axd files, as others have seen. The solution is to include the source js files directly in your application instead of getting them generated from the AjaxControlToolkit.dll. This works well for most of the files. But I can't find MicrosoftAjax.js on my machine. Where can I get this file? Specifically, where can I get the 3.5 version of the file? 回答1: You can get to it by using reflector to

Error using Ajax.BeginForm when giving a callback parameter for OnSuccess, OnFailure, OnComplete and OnBegin

℡╲_俬逩灬. 提交于 2019-12-11 17:41:36
问题 I'm trying to use an Ajax form, and whenever I provide a callback method to any of the AjaxOptions properties I get this error.. Microsoft JScript runtime error: Object doesn't support this property or method If I do not provide a callback function to any of the properties (OnSuccess, OnFailure, OnComplete, or OnBegin) no error occurs and the form gets posted correctly. Here is my code. <% using (Ajax.BeginForm("someAction", "SomeController", new AjaxOptions() { HttpMethod="POST",

Update Table via Binding Model in ASP .Net Core 2.2

拥有回忆 提交于 2019-12-11 17:06:40
问题 I want to change creating table conditions like this: There is a way of creating table via list model. My aim, when input a number in Determine Number Text Box, then the table will change according to Determine Number. Example: If DetermineNumber is 5, then the table's row is 5 and the structure of this table will be same like older (A column 0 and B column 0++). Here is my code: //My Home Controller using Microsoft.AspNetCore.Mvc; using MyWeb.Models; using System.Collections.Generic;