asp.net-ajax

MVC 4 Ajax.BeginForm POST does not bind to model in conroller

时光怂恿深爱的人放手 提交于 2019-12-22 09:58:14
问题 Sorry for the amount of code here but it's the best way to explain what;s happening. I gave this code in my MVC 4 partial view: <script src="~/Scripts/jquery.unobtrusive-ajax.js"></script> @using (Ajax.BeginForm("TestPost", new AjaxOptions { HttpMethod = "Post" })) { foreach (var d in Model.DataItemsWithLabels) { @Html.LabelFor(m => d.DataName) @Html.TextBoxFor(m => d.DataValue); } <input type="submit" value="Save" /> } And my controller action is as follows: public ActionResult TestPost

ScriptManager run script immediately

孤街醉人 提交于 2019-12-22 09:49:09
问题 I have an update panel load a user control, and the goal here is to have a specific JavaScript function called when this occurred. I was thinking this would be done through the Script Manager, though this does not need to be the case if there's an html alternative. The flow is basically the following: User clicks button Update panel loads control Javascript function is called Many thanks I've already tried RegisterStartupScript(..) , though i may have made a syntactical mistake if (show) {

ASP.Net + jQuery + jQuery validation plugin + UpdatePanel + nyroModal - success firing on each field!

好久不见. 提交于 2019-12-22 09:35:08
问题 I have a form containing a list of input fields that the user populates with prices (numbers). I have set their css classes to "required" and "number" so that the jQuery validation plugin validates them accordingly. All that is working perfectly well. The errors are displayed when each field is either not a number or the value is missing etc. This entire form is actually inside a nyroModal (jQuery plugin) model popup window. But that shouldn't matter, its just an .aspx web form regardless.

Update Progress animated gif stops on postback

社会主义新天地 提交于 2019-12-22 08:46:14
问题 I have used ajax update progress control that shows the animated gif when postback happens. Problem: It displays for a while but then it stops refershing (or rather, stops playing/revoloving). What could be the actual cause of the same? Please advice!. Thanks! 回答1: The animation of a .gif will stop on PostBack with Internet Explorer. The problem is inherent to Internet Explorer. Apparently this issue goes all the way back to IE 6 (though I've only confirmed it in IE8). There is a little hack

cannot be processed at the receiver, due to an AddressFilter mismatch at the EndpointDispatcher

风流意气都作罢 提交于 2019-12-22 08:21:04
问题 I am using ajax enabled WCF, when i open the url in web browser i am getting this error. The message with Action 'http://localhost:22219/MobileService.svc/GetProductCategories' cannot be processed at the receiver, due to a ContractFilter mismatch at the EndpointDispatcher. This may be because of either a contract mismatch (mismatched Actions between sender and receiver) or a binding/security mismatch between the sender and the receiver. Check that sender and receiver have the same contract

ScriptResource.axd 404 not found

对着背影说爱祢 提交于 2019-12-22 07:04:53
问题 I have this WebApp in .NET 3.5, using MS Ajax and jQuery UI. It works fine locally but when I publish it on the statging server it gives a 'Sys' undefined javaScript error. Furhter investigation, I found that the .axd files are not loaded and it is a 404. I checked the web.confing and I have the necessary entries under the . I googled and read every post and could not find a solution for it. Is there anyone who has run in to a prblme like this before? 回答1: I just ran into it with our server

Detect if Asp.Net form is valid with javascript/jquery

此生再无相见时 提交于 2019-12-22 06:47:56
问题 I have a form which is in an updatePanel and I have a span with hidden loading image, which I want to show when user clicks to submit button but I first need to check if page is valid on client side. Also I'm making loading span visible with jQuery. Here is my code: <html> <head> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js" type="text/javascript"></script> <script type="text/javascript"> function showLoading() { $('#loader').show(); } </script> </head> <body>

ASP.NET Ajax - Asynch request has separate session?

孤街醉人 提交于 2019-12-22 06:46:37
问题 We are writing a search application that saves the search criteria to session state and executes the search inside of an asp.net updatepanel. Sometimes when we execute multiple searches successively the 2nd or 3rd search will sometimes return results from the first set of search criteria. Example: our first search we do a look up on "John Smith" -> John Smith results are displayed. The second search we do a look up on "Bob Jones" -> John Smith results are displayed. We save all of the search

Multiple Async postbacks at the same time - ASP.NET

不问归期 提交于 2019-12-22 06:34:03
问题 Say I have 2 UpdatePanels on the page and each UpdatePanel has a one server Button each. When I click on the first button and then the second button and look in Firebug, I see that the 2nd async postback is not triggered until the first one completes. Is this working as expected? My understanding was with AJAX postbacks, the event handlers for the buttons trigger simultaneously. EDIT: Any help anyone? 回答1: It is accurate for that model. You probably want pagemethods. EDIT: drachenstern says

Combining AjaxOnlyAttribute and ChildActionOnlyAttribute into one action filter

元气小坏坏 提交于 2019-12-22 05:09:13
问题 I want to be able to mark an action on controller to be called both from ajax calls and via RenderAction. The problem is that both this attributes derive or implement different abstractions. One way out is the next: [AjaxOnly] PartialViewResult GetViewAjax(int foo) { return GetView(foo); } [ChildActionOnly] PartialViewResult GetView(int foo) { ... } But this is not neat at all. The AjaxOnly attribute I am talking about is: public sealed class AjaxOnlyAttribute : ActionFilterAttribute {