asp.net-ajax

ASP.Net AJAX JavaScript Serialization Error

冷暖自知 提交于 2019-12-06 20:52:32
Ran into an “Out of Stack Space” error trying to serialize an ASP.Net AJAX Array object. Here is the scenario with simplified code: Default.aspx MainScript.js function getObject(){ return new Array(); } function function1(obj){ var s=Sys.Serialization.JavaScriptSerializer.serialize(obj); alert(s); } function function2(){ var obj=getObject(); var s=Sys.Serialization.JavaScriptSerializer.serialize(obj); alert(s); } Content.aspx ContentScript.js function serializeObject(){ var obj=window.top.getObject(); window.top.function1(obj); // <– This works fine obj=new Array(); window.top.function1(obj);

Viewstate Optimisations

有些话、适合烂在心里 提交于 2019-12-06 17:12:13
问题 Hy, I'm interested in some general optimisation methods in an asp.net ajax project for Viewstate (ex. to reduce the size of viewstate , or just speeding up the viewstate somehow, or others this should be a general discussion :-) ). So what kind of optimisation do you use for ViewState? What possibilities are offered on Asp.net or Ajax framework? 回答1: @silky is right, disable it where ever you can. We try to keep it disabled on as many controls as possible. Also, once you're using as little as

Drag n Drop Inside 2 Listbox in Asp.Net

帅比萌擦擦* 提交于 2019-12-06 16:39:53
I want to implement Drag n Drop Functionality in 2 List/Combo Box in Asp.Net.I will select and drag 1 item from listbox1 and drop it on Listbox2. So How should i start with ? Is there any Jquery Plugin Available ? Thank Rick Jackson I'm using this two great plugins for drag and drop. They have a lot of ready to use samples: http://threedubmedia.com/code/event/drag http://threedubmedia.com/code/event/drop There are a lot of plugins available on net,but you can achieved the by using java script.I have created a sample app in asp.net.Check out this and let me know if you have any doubt. <%@ Page

What is the request life cycle for asynchronous (ajax) ASP.NET Page Method calls?

大憨熊 提交于 2019-12-06 16:33:43
What is the application event/processing timeline for an asynchronous request made to a page method on a Web Form? Looking for a canonical answer or resource. Note: This is a request for information about how ASP.NET AJAX handles incoming requests made to web services exposed to client script as described here in the section named "Calling Static Methods in an ASP.NET Web Page." This is not to be confused with the page life cycle. It should also be mentioned that [WebMethod] and [ScriptMethod] are features of ASP.NET AJAX, and not XML Web Services, as one might infer when reading certain MSDN

Url.Action: How to Pass Parameter from View to Controller?

可紊 提交于 2019-12-06 15:55:51
I'm having issues with passing a parameter from my View to Controller using Url.Action. My code is the following in the View: <form id="searchForm"> <input type="text" name="search_criteria" /> <input type="submit" value="Search" /> </form> <div id="SearchDiv"> </div> In my Script: $('#searchForm').submit(function (e) { e.preventDefault(); $.ajax({ url: '@Url.Action("Index_AddSearchCriteria", "Home", "search_criteria")', type: 'POST', dataType: 'html', success: function (result) { $('#SearchDiv').html(result); } }) }) In the Controller: public PartialViewResult Index_AddSearchCriteria(string

find is not a function jquery

本小妞迷上赌 提交于 2019-12-06 13:51:49
问题 good day, I have my view, where I am trying to render a template <div id="template" style="display:none;"> <div class="col-lg-4 col-md-6 col-sm-12"> <div class="thumbnail"> <a href="" class="btn btn-primary btn-sm editar">Editar</a> <h3 class="centrar"></h3> <a class="index" href=""> <img class="image" src="" /> </a> <p class="description">data[i].Descripcion</p> </div> </div> And an ajax call //ajax starts here... //.... success: function (data) { $.each(data, function (index, item) { var

Ajax.BeginForm not hiding loading element when onBegin fails

不想你离开。 提交于 2019-12-06 13:45:35
I'm using the Ajax.BeginForm helper in my MVC app. Here's a simplified example: <% using (Ajax.BeginForm("actionName", new { Controller = "controller" }, new AjaxOptions { OnBegin = "doValidation", LoadingElementId = "ajaxLoader" })) { %> The problem is that if the OnBegin callback returns false, which correctly prevents the ajax call from being made, the loading element "ajaxLoader" is still displayed, and not hidden. I've tried using the OnFailure and OnComplete callbacks, but neither of these are called if the OnBegin callback fails. Interestingly the loading element is not displayed until

Asp.Net Ajax WebService and Internal Error 500

无人久伴 提交于 2019-12-06 13:27:16
问题 I can call the webservie directly to the browser with the following URL and it returns be all what I want : http://localhost:64438/MySearchAutoComplete.asmx/GetCompletionList When I add it to an autocompleteexetender into the Default.aspx page like that : <cc1:AutoCompleteExtender ID="AutoCompleteExtender1" TargetControlID="TextBox1" runat="server" ServiceMethod="GetCompletionList" ServicePath="http://localhost:64438/MySearchAutoComplete.asmx" CompletionSetCount="12" MinimumPrefixLength="1" /

How do I code my ASP.NET page to parallelize downloads across hostnames?

心不动则不痛 提交于 2019-12-06 12:35:35
问题 Google Page Speed test tells me I need to distribute my queries across DNS Domain names to speed up rendering. Since I do development offline, I'd like to find a solution that will distribute my static content (img, CSS, js) across different hostnames, and will still work when I'm offline in an airplane. Q: How can I code my page to use relative paths (or local host) when offline, and to consistently send static content requests among 5 hosts? After reading this I'd like the url to be similar

Tearing my hair out - ASP.Net AJAX AutoComplete not working

 ̄綄美尐妖づ 提交于 2019-12-06 12:13:47
Hope someone can help with this. I've been up and down the web and through this site looking for an answer, but still can't get the Autocomplete AJAX control to work. I've gone from trying to include it in an existing site to stripping it right back to a very basic form and it's still not functioning. I'm having a little more luck using Page Methods rather than a local webservice, so here is my code <%@ Page Language="C#" AutoEventWireup="true" CodeFile="droptest.aspx.cs" Inherits="droptest" %> <%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %> <