asp.net-ajax

jQuery AJAX JSON response returns key “d”

痞子三分冷 提交于 2019-12-06 01:43:27
问题 When I make a jQuery AJAX JSON request, it responds with a "d" attribute. Why is this? 回答1: here a good article about it http://encosia.com/2009/06/29/never-worry-about-asp-net-ajaxs-d-again/ “.d” what? If you aren’t familiar with the “.d” I’m referring to, it is simply a security feature that Microsoft added in ASP.NET 3.5’s version of ASP.NET AJAX. By encapsulating the JSON response within a parent object, the framework helps protect against a particularly nasty XSS vulnerability. 回答2: If

AJAX .post async

廉价感情. 提交于 2019-12-06 01:39:18
What exactly does the following do: $.ajax({ type: "POST", async: false, vs $.ajax({ type: "POST", async: true, Meaning what is the difference in the behavior? From the jQuery site : By default, all requests are sent asynchronously (i.e. this is set to true by default). If you need synchronous requests, set this option to false. Cross-domain requests and dataType: "jsonp" requests do not support synchronous operation. Note that synchronous requests may temporarily lock the browser, disabling any actions while the request is active. That's all there is to it. If you need help on a specific

How to get the id of Updatepanel which initiated a postback

血红的双手。 提交于 2019-12-06 00:00:36
问题 Hi I need to intercept server callback after udate panel async post back and determine which panel initiated the request. The code is pretty simple: Sys.WebForms.PageRequestManager.getInstance().add_pageLoaded(InterceptUpdateCallback); function InterceptUpdateCallback(sender, args) { var updatedPanels = args.get_panelsUpdated(); for (idx = 0; idx < updatedPanels.length; idx++) { if (updatedPanels[idx].id == "myUpdatePanel") { StartSmth(); break; } } } And it works when UpdatePanel is not

Deploying ASP.net Ajax 1.0 and 3.5 web application on same server

对着背影说爱祢 提交于 2019-12-05 23:20:26
We have a production Server which has ASP.net 2.0 Application running with Ajax 1.0 and corresponding toolkit (Toolkit version 1.0.20229). I have been asked to move another application build using ASP.net 3.5 which also utalizes latest ASP.NET AJAX and corresponding toolkit (Toolkit Version 3.0.X). Can these two application exist on the same server, if I install .Net Framework 3.5 ( current version on the server is 2.0)? What all should I do to make sure there is no compatability issues? Please let me know if the question is not clear. Thank you, The Mar RESULT: Installed Framework 3.5.

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

心已入冬 提交于 2019-12-05 22:20:09
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(CmaPartialModel model) { return PartialView("Transaction", model); } In my model I have some code that

ScriptManager run script immediately

谁都会走 提交于 2019-12-05 22:00:40
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) { string scriptId = String.Format("{0}:script", ++uniquePopupId); string scriptTag = String.Format(

HTTP Handler cannot find axd file in nested web application folder: Telerik RadScriptManager cannot find WebResource.axd in ~/admin/ folder

拈花ヽ惹草 提交于 2019-12-05 21:05:09
We have a web application with 2 web.config files. I'm using the telerik:RadScriptManager control within an ASP.NET page. There is web resource file (WebResource.axd) that this control needs access to for it's ScriptReferences. I think this .axd file contains the JavaScript files for Telerik's controls. All of our Rad Controls are implemented in a separate web application (.csproj) project called "admin". The root web application project (.csproj) has a folder called "admin" where all of the admin project files live, including the admin web.config. The page I'm having an issue with here also

track the progress of a database save in a “live” progress bar asp.net mvc

僤鯓⒐⒋嵵緔 提交于 2019-12-05 19:04:03
I need to show the progress of a SQL load in .net 4.5. The objective is to show a "Live" flow of the uploads happening. So that the person uploading the information can see that the upload is working. Controller Method: private void ProgressUpload(int? SystemGeneralAnnouncementId) { var systemGeneralAnnouncement = (SystemGeneralAnnouncementId == null) ? null : _uow.SystemGeneralAnnouncementRepository.GetById(SystemGeneralAnnouncementId.Value); List<Status> status = new List<Status>(); if (systemGeneralAnnouncement.Statuses.Length > 0) { status.AddRange(systemGeneralAnnouncement.Statuses.Split(

Ajax.BeginForm not working with Html.ValidationSummary

青春壹個敷衍的年華 提交于 2019-12-05 18:50:20
I am trying to use the Ajax.BeginForm to post data to a controller. In the case of specific errors, the form should re-render and display the custom error message that was added to the ModelState. For some reason, the error message is not displaying. I am even trying the following test case which is not working, am I missing something? Edit.cshtml: @using (Ajax.BeginForm("Edit", "UserInformation", FormMethod.Post, new AjaxOptions { HttpMethod = "Post", InsertionMode = InsertionMode.Replace, UpdateTargetId = "divFormContainerMain", LoadingElementId = "divPreLoader", OnSuccess = "onSuccess" }))

How do I use a jQuery $(document).ready and an ASP.NET UpdatePanel together?

半城伤御伤魂 提交于 2019-12-05 17:50:43
I'm rocking this bit of Javascipt in the <head> section of my page: <script type="text/javascript"> $(document).ready(function() { $('dl.expander dd').expander ( { slicePoint: 50, widow: 2, expandEffect: 'show', userCollapseText: '[^]' } ); }); </script> This works great the first time the page is loaded; however, when I click an <asp:button> that is inside an <asp:updatepanel> the page is partially refreshed, but the $(document).ready is never called again. This is important, because this Javascript in the $(document).ready section is collapsing and adding a "readmore" option to a list of