asp.net-ajax

ASP.net PageMethods return undefined

走远了吗. 提交于 2019-12-20 05:17:27
问题 Hi everyone i trying to get data from cs to js using ToolkitScriptManager. this is my aspx : <html xmlns="http://www.w3.org/1999/xhtml"> <head runat="server"> <title></title> <script src="../assets/lib/jquery/jquery-2.0.3.js" type="text/javascript"></script> <script> $(window).load(function () { alert(PageMethods.isConnected()); }); </script> </head> <body> <form id="form1" runat="server"> <asp:ToolkitScriptManager runat="Server" EnablePageMethods="true" EnablePartialRendering="true" /> <div>

why do we need a script manager always when we are using Ajax control?

爷,独闯天下 提交于 2019-12-20 03:40:11
问题 why do we need a script manager always when we are using Ajax control? 回答1: Script manager control is the control that send the scripts to the client. This control is at the heart of all AJAX related functions. It manages all controls in your Ajax enabled page. It also ensures that partial page updates happen as it is expected. http://msdn.microsoft.com/en-us/library/system.web.ui.scriptmanager.aspx 来源: https://stackoverflow.com/questions/4468230/why-do-we-need-a-script-manager-always-when-we

How to get child controls correct id to client side

[亡魂溺海] 提交于 2019-12-20 02:54:37
问题 I am working on ASP.NET and not using any ASP.NET's AJAX framework. Now I am trying to update the contents of the textboxes and dropdowns in the Grid controls cell on client side using (classic JavaScript way)AJAX. But problem I am facing is that controls (textbox, dropdown) which I would like to update when rendered on the client side get prefixed by the User Controls id and row ids. So it becomes like UserContro_row_no_controlId . With this it is becoming difficult to keep track of controls

Cannot do response.redirect from page with Ajax controls

我们两清 提交于 2019-12-19 11:27:02
问题 I have a page that contains many user controls, each of which uses Ajax. When I load this page, under certain conditions, I want to do a response.redirect; however response.redirect statement is being trapped by Ajax code and never happens. How do I do a response.redirect from a page that contains Ajax controls? Thanks.... 回答1: Instead of using Response.Redirect, you can use Javascript to redirect. window.location = "[url to redirect]"; 回答2: add this to your web.config: <httpModules> <add

Disable ScriptManager on certain pages

杀马特。学长 韩版系。学妹 提交于 2019-12-19 09:11:29
问题 I have a script manager on my Master page. There are one or 2 content pages that I need to remove the webresourse.axd from, as it is causing issues with other javascript on the page How can I disable the script manager on these pages? The ScriptManager object doesnt appear to have any properties that would seem like they would do the job Is this possible? 回答1: Move your <asp:ScriptManager /> to a custom control e.g. MyScriptManager.ascx - the only code in the .ascx file will be the

ASP.NET UpdatePanel Javascript Callback

最后都变了- 提交于 2019-12-19 07:17:21
问题 I came across this issue recently and thought it was really helpful. My question was, how would you call a piece of javascript after an updatepanel loads via AJAX in ASP.NET? I needed to reinitialize a jQuery datepicker after the panel had loaded. 回答1: <script type=”text/javascript”> var prm = Sys.WebForms.PageRequestManager.getInstance(); prm.add_pageLoaded(panelLoaded); function panelLoaded(sender, args){ // Your code here } </script> Essentially this is creating an instance of the

TinyMCE with AJAX (Update Panel) never has a value

岁酱吖の 提交于 2019-12-19 05:34:32
问题 I wanted to use a Rich Text Editor for a text area inside an update panel. I found this post: http://www.queness.com/post/212/10-jquery-and-non-jquery-javascript-rich-text-editors via this question: Need ASP.Net/MVC Rich Text Editor Decided to go with TinyMCE as I used it before in non AJAX situations, and it says in that list it is AJAX compatible. Alright I do the good ol' tinyMCE.init({ //settings here }); Test it out and it disappears after doing a update panel update. I figure out from a

TinyMCE with AJAX (Update Panel) never has a value

不问归期 提交于 2019-12-19 05:34:07
问题 I wanted to use a Rich Text Editor for a text area inside an update panel. I found this post: http://www.queness.com/post/212/10-jquery-and-non-jquery-javascript-rich-text-editors via this question: Need ASP.Net/MVC Rich Text Editor Decided to go with TinyMCE as I used it before in non AJAX situations, and it says in that list it is AJAX compatible. Alright I do the good ol' tinyMCE.init({ //settings here }); Test it out and it disappears after doing a update panel update. I figure out from a

ASP.Net button click event not firing

自闭症网瘾萝莉.ら 提交于 2019-12-19 03:52:54
问题 This is perhaps related to this question, but I have slightly more information. I recently updated an ASP.Net application to .NET 3.5 after coding a few new pieces with Linq. Now my pages intermittently stop firing event handlers. I have it narrowed down to pages with Ajax on them, and I assume it's either the ScriptManager or the AjaxControlToolkit registration that is precipitating the problem. The really screwy part is that pages seem to work fine about 2/3s of the time, and the controls

Microsoft JScript runtime error: 'Sys' is undefined

时光毁灭记忆、已成空白 提交于 2019-12-18 18:52:10
问题 I have a page with the following code on it: <script type="text/javascript" language="javascript"> /// <reference name="MicrosoftAjax.js" /> Sys.WebForms.PageRequestManager.getInstance().add_endRequest(EndRequestHandler); function EndRequestHandler(sender, args) { ToggleTimeDiv(); } </script> When the page loads I get the following error: Microsoft JScript runtime error: 'Sys' is undefined I'm using Visual Studio 2008 Standard Edition. What is causing this error? 回答1: Is your <script> block