asp.net-ajax

Difference between script manager and toolkit script manager

别等时光非礼了梦想. 提交于 2019-11-30 01:08:47
问题 What are the differences between ScriptManager and ToolkitScriptManager ? I found only one convincing reason: that ToolkitScriptManager improves page performance. If so why use ScriptManager ? 回答1: First of all: if you use ASP.NET 3.5 and controls from AJAX Control Tookit then you must use the ToolkitScriptManager, rather than the ASP.NET ScriptManager. This limitation according to the fact that toolkit script manager adds updated Ajax scripts and without that most of the controls from Ajax

Globally log exceptions from ASP.NET [ScriptService] services

纵饮孤独 提交于 2019-11-30 00:34:09
I'm using the [System.Web.Script.Services.ScriptService] tag to use web services callable from client side javascript. What I need is a way of globally logging any unhandled exceptions in those methods. On the client side, I get the error callback and can proceed from there, but I need a server-side catch to log the exception. The guy at this url: http://ayende.com/Blog/archive/2008/01/06/ASP.Net-Ajax-Error-Handling-and-WTF.aspx suggests that this can't be done. Is that accurate? Do I seriously have to go to every single webmethod in the entire system and try/catch the method as a whole.

Replace UpdatePanel with JQuery

两盒软妹~` 提交于 2019-11-29 23:18:49
I'm using UpdatePanel to asynchronously call a button click event in a page that calls a method in another class which writes out an XML file on the output. Is there a way to do this with JQuery instead of UpdatePanel? Use jQuery to handle the click event. Then call a page method in the code-behind using this technique . From there you can write the XML file or do whatever else you want. Aleris A simple alternative way to using jQuery to do ajax without the update panel is to use a build in mechanism of ASP.NET called 'page methods'. By decorating a static method in the page behind with

Adding PostBackTriggers and AsyncPostBackTriggers to UpdatePanel for dynamically-generated grandchild controls

给你一囗甜甜゛ 提交于 2019-11-29 21:37:13
问题 I have a page with a ScriptManager, a generic HTML drop-down list ( <select> ), and an UpdatePanel. The UpdatePanel contains a PlaceHolder (for now). During Page_Load, a number of user controls are added to the PlaceHolder (really, it's several instances of the same user control). The number to add is not known until the page loads, so they do need to be loaded dynamically. The drop-down list is populated with the same number of menu items, and there is javascript on the page also (using

How to control which JavaScript gets run after UpdatePanel partial postback endRequest?

南楼画角 提交于 2019-11-29 20:03:23
问题 I know I can hook into the client side events to run JavaScript after every partial postback; however, I want to do something like this: protected void FooClicked(object sender, EventArgs e) { ClientScript.RegisterStartupScript(GetType(), "msg", "showMsg('Foo clicked');",true); } I know I could totally hack it with hidden fields and run something after every postback, but there should be a pretty straightfoward way to in a similar fashion to this. 回答1: The specific code sample you are

The required anti-forgery form field “__RequestVerificationToken” is not present in ajax call

本小妞迷上赌 提交于 2019-11-29 17:36:45
I have the following method in controller [HttpPost] [Authorize(Roles ="Klient")] [ValidateAntiForgeryToken] public ActionResult GetAvaiableHouses(DateTime startDate, DateTime endDate) { Session.Remove("Reservation"); IEnumerable <SelectListItem> avaiableHouses = repository.GetAllNamesAvaiableHouses(repository.GetAvaiableHousesInTerm(startDate, endDate)); List<string> houses = new List<string>(); avaiableHouses.ToList().ForEach(item => houses.Add(item.Value)); if(avaiableHouses.ToList().Count == 0) { return new EmptyResult(); } Session["Reservation"] = new NewReservation() { StartDate =

Print contents of a modal popup

浪子不回头ぞ 提交于 2019-11-29 17:35:31
I have an application that shows a list of items. The user can click on an item and see its details in a modal popup (centered DIV, shown using JavaScript). I need to have a button on that popup that will allow the user to print out the contents of the modal popup only. This is for an internal application that needs to work in IE7+ only. When the user clicks the print button on the modal popup the state of the item gets changed to "printed" (for internal business reasons...). I am using ASP.NET and the ASP.NET AJAX Control Toolkit ModalPopupExtender , but I am guessing that the technique to

Internet Explorer's Operation Aborted and Latency Issue

守給你的承諾、 提交于 2019-11-29 16:02:29
If you don't know what the operation aborted error is, here's a Microsoft KB Article about it, http://support.microsoft.com/default.aspx/kb/927917 . There's also tonnes of posts about it but the simple answer for it's occurrence is this; the error only occurs if you try to manipulate a DOM element via JavaScript before the element you are trying to manipulate is loaded. I know how Internet Explorer's (IE) infamous Operation Aborted occurs and know how to fix it. The problem I have is a very weird scenario. Testing locally and on a development machine with IE7, I never ever get the operation

AJAX progress bar dispaying loading progress percentage for page load

心不动则不痛 提交于 2019-11-29 16:01:06
How do you use a progressbar to show the loading percentage for a page? ...(similar to how they show in flash) Thanks Impossible(on IE8 & FF3 & Opera without plugin or extension). If you want real loading percentage include HTML + Javascript + Stylesheet + Image. you can only detect how many file loaded to page(only Image & javascript can be detected by this technique). I would say that if you need a progressbar for a page, that page might need some rethinking. Personally I don't like pages that have progress bars (Like the one in the ASUS Download Area). They are just annoying. My browser

How to use a jQuery UI Modal Form from ASP.Net MVC list page

China☆狼群 提交于 2019-11-29 15:27:49
问题 I am tryng to use this: http://jqueryui.com/demos/dialog/#modal-form I have: <script type="text/javascript"> $(document).ready(function() { $("#dialog").dialog(); $("#dialog").dialog('close'); $('.myPop').click(function() { $("#dialog").dialog('open'); }); }); Which allows me to pop-up on the click of '.myPop' which is just a temp input button in my list which is working: <button type="button" class="myPop"></button> My question is - what is the best way to use this pop-up to go to the Edit