asp.net-ajax

How to wait on the __doPostBack method to complete in javascript?

人盡茶涼 提交于 2019-12-03 08:44:32
问题 I am using the __doPostBack method to refresh the UpdatePanel in javascript. I just want to wait for the update panel to get updated and then execute the subsequent javascript code. How do I wait on an asynchronous method to complete before I proceed further with execution (like in my case the asynchronous method is __doPostBack)? I want to simulate something like the way it is doing in C# using Thread.Join() method. 回答1: Use the Sys.WebForms.PageRequestManager endRequest event: <script type=

Asp.net Dynamic Validators don't work in Chrome or Safari

泪湿孤枕 提交于 2019-12-03 08:40:24
Ok, I'm dynamically creating Asp.net validation controls and inserting them into an update panel. The validation works in IE and Firefox, but not in Chrome or Safari. Here is the aspx file. Don't ask why I'm not using a button server control... <asp:ScriptManager ID="ScriptManager1" runat="server" /> <div> <asp:Label ID="Label1" runat="server" Text="Label"></asp:Label> <asp:UpdatePanel ID="UpdatePanel1" UpdateMode="Always" runat="server"> <ContentTemplate> <asp:PlaceHolder ID="PlaceHolder1" runat="server"></asp:PlaceHolder> <input id="Button1" type="button" value="submit" onclick='javascript

ASP.NET Ajax client-side framework failed to load .net 4.0

拟墨画扇 提交于 2019-12-03 08:09:58
Good Evening, I am experiencing a strange problem. I only experience the problem when the site has been deployed to IIS 7.0. The web page renders fine when launched in VS 2010; however when viewed to IIS 7.0 the entire page gets shifted to the right. errors only happen when this is on the .aspx page <telerik:RadScriptManager ID="RadScriptManager" runat="server" /> Web.config file below.... Please let me know if you need anything else. Thanks, Brennan Web.config --- <authentication mode="Forms"> <forms loginUrl="login" timeout="2880" /> </authentication> <membership defaultProvider=

Ajax Request returns HTTP error 500, using MVC and $.ajax call with POST?

蹲街弑〆低调 提交于 2019-12-03 07:36:41
问题 I've seen several threads about this, and I've tried all the answers (ASP.NET MVC JsonResult return 500) My ajax request is re-turning a 500 Internal Error. If I debug I never even get to my action. Here is my ajax call: $.ajax({ url: '@Url.Action("UpdateSortOrder", "FormItems")', data: { itemToUpdateId: item.attr("id"), newParentItemId: parentItemId, newPreviousItemId: previousItemId }, type: 'POST', success: function (data) { console.log(data); }, error: function (xhr, status, exception) {

UpdatePanel Exception Handling

Deadly 提交于 2019-12-03 07:11:48
问题 Where exceptions occur in the UpdatePanels I've implemented in the ASP.NET web app I'm building, they cause a JavaScript error on the page with some high level error output available in the alert. This is OKish for development, but as soon as the system is in Production, it's obviously no good for multiple reasons. I can surround troublesome activities with Try Catch etc to control the Javascript error but in some cases, I want to take actions on the main page etc to support the user

jQuery vs MicrosoftAjax in ASP.NET MVC

限于喜欢 提交于 2019-12-03 06:38:39
Under what circumstances would you use MicrosoftAjax over jQuery in an ASP.NET MVC application? According to Scott Cate in this podcast Object Oriented AJAX with Scott Cate MicrosoftAjax is good for sending and retrieving data to and from the server. And jQuery is good for manipulating your data via the DOM once it arrives at the client. Yet, with a simple form plugin for jQuery you can send and retrieve data with jQuery quite easily. Often with a single line of code. So I'm wondering what the difference is between MicrosoftAjax and jQuery within ASP.NET MVC? Go with jQuery - even Microsoft

GWT and .NET

*爱你&永不变心* 提交于 2019-12-03 06:19:16
问题 How can I use GWT together with Visual Studio to create an ASP.NET website? If it is possible. Thanks 回答1: You can use GWT to generate the client side code writing in Java and use asp.net for the back end. It's a little trickier as you won't get the serialization across the wire for free that you'd get from using Java on the back end too. I wouldn't really recommend this approach it's bound to be a hassle to maintain. I'd recommend using a good javascript toolkit instead, such as jquery and

Method 'get_EnableCdn' in type 'System.Web.UI.ScriptManager' from assembly 'System.Web.Extensions' does not have an implementation

℡╲_俬逩灬. 提交于 2019-12-03 04:12:10
Can anyone explain a perse error like this one: "Method 'get_EnableCdn' in type 'System.Web.UI.ScriptManager' from assembly 'System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' does not have an implementation." My dev box runs Windows 7, framework 4.0 and latest Ajax tool kit. Site works locally as well as on test server (win 2003, framework 4.0 and latest Ajax tool kit), but on the production server (again Win 2003) the story is different. Ironically, the site on production server has been upgraded to framework 4.0 several months ago and works fine until

AsyncFileUpload file size limit

倾然丶 夕夏残阳落幕 提交于 2019-12-03 03:40:18
When I was using AsyncFileUpload to upload 100KB image, I got no error message., but image not uploaded. I can upload 75KB image succssfully. I am using IIS 6.0. <cc1:AsyncFileUpload ID="afuImg" Width="400px" runat="server" UploaderStyle="Traditional" ThrobberID="Throbber2" OnClientUploadError="uploadErrorImg" OnClientUploadStarted="StartUploadImg" OnClientUploadComplete="UploadCompleteImg" /> <httpRuntime maxRequestLength = "1024000" executionTimeout="54000" enableHeaderChecking ="false" /> kamui You can upload files with a combined size of up to 2GB, but it requires some modifications in

How to implement a file download in ASP.NET AJAX

会有一股神秘感。 提交于 2019-12-03 00:18:52
I would like to use standard ASP.NET file download response, like in other Stack Overflow question . Response.ContentType = "application/octet-stream"; Response.AppendHeader("Content-Disposition","attachment; filename=logfile.txt"); Response.TransmitFile( Server.MapPath("~/logfile.txt") ); Response.End(); But inside update panel it does not work. What I have to do, that I will get a file if the download event is triggered inside update panel? Well, I have found nice blog post on Encosia which describe solution of this ASP.NET AJAX file download problem. It work really nice. http://encosia.com