I've created a form as an ASP.NET usercontrol which uses updatepanels and the AjaxControlToolkit. This functions perfectly when debugged through Visual Studio. The UserControl displays fine when added to Umbraco, but each function that should update through Ajax is causing the whole page to post back. What's the difference when this is added to an Umbraco site? Is there something I should know or a config setting I should know about?
Are you receiving a JavaScript error before the PostBack occurs (that can be hard to spot, open up your fav web dev tool <firebug, IE dev toolbar, chrome dev tools>)?
My money is on a JavaScript error on the page, if this occurs the button you've clicked wont have preventDefault applied to the click event causing it to still act like a normal button.
@Tom Maton: My control have a target .net framework 3.5 in project properties. I am also using LINQ-SQL in it. If I changed it to 2.0, i dont think then i can use LINQ-SQL.
@Slace: There is not any Js error, I confirmed (also using tools you told). And ScriptManager is there. As some of my conrols are behaving under AJAX (like a check box there). A map there which is build using ASP.NET map area control (built-in) and jQuery. This map does not behave under AJAX and makes post back all times on Umbraco.
Slace, thanks for your help, ignoring the weird guy who pretended to be me...
I loaded the page in IE and you were right, there are Javascript errors. I get "Sys.InvalidOperationException: The PageRequestManager cannot be initialized more than once". I don't have a scriptmanager on the masterpage, it is within the UserControl itself. Are you suggesting I put a scriptmanager on the masterpage and remove the one from the UserControl?
No AJAX with UserControl?
Hi everyone,
I've created a form as an ASP.NET usercontrol which uses updatepanels and the AjaxControlToolkit. This functions perfectly when debugged through Visual Studio. The UserControl displays fine when added to Umbraco, but each function that should update through Ajax is causing the whole page to post back. What's the difference when this is added to an Umbraco site? Is there something I should know or a config setting I should know about?
Thanks for any help
Shufflemoomin
What version of the .NET framework you using to build your control?
As umbraco is built on the 2.0 framework so it could be referencing the incorrect one.
Tom
Credit: Slace
Have you got a ScriptManager on your master page?
Are you receiving a JavaScript error before the PostBack occurs (that can be hard to spot, open up your fav web dev tool <firebug, IE dev toolbar, chrome dev tools>)?
My money is on a JavaScript error on the page, if this occurs the button you've clicked wont have preventDefault applied to the click event causing it to still act like a normal button.
Hi, Thanks for your replies guys.
@Tom Maton: My control have a target .net framework 3.5 in project properties. I am also using LINQ-SQL in it. If I changed it to 2.0, i dont think then i can use LINQ-SQL.
@Slace: There is not any Js error, I confirmed (also using tools you told). And ScriptManager is there. As some of my conrols are behaving under AJAX (like a check box there). A map there which is build using ASP.NET map area control (built-in) and jQuery. This map does not behave under AJAX and makes post back all times on Umbraco.
Shufflemoomin
Try adding your own JavaScript event handler to the button and see if that fires.
I personally don't use UpdatePanel's but when I use to use them and they would have problems it was caused by JavaScript not working right.
Also, try attaching the the PageRequestManager and seeing what parts of the client page life cycle are being run.
@Kresten Banke: Why are you hijacking my thread and posting as me? What the hell?
Shufflemoomin
Slace, thanks for your help, ignoring the weird guy who pretended to be me...
I loaded the page in IE and you were right, there are Javascript errors. I get "Sys.InvalidOperationException: The PageRequestManager cannot be initialized more than once". I don't have a scriptmanager on the masterpage, it is within the UserControl itself. Are you suggesting I put a scriptmanager on the masterpage and remove the one from the UserControl?
Thanks for the advice
Shufflemoomin
Hi Shufflemoonin - I appologize!
A developer who is working on my project confused our two threads!
We have posted more or less the exact same problem at just about the same time!
Slace has been kind enough to assist us both, so the threads have looked identical...
My appologies!
See my thread here:
http://our.umbraco.org/forum/developers/extending-umbraco/9531-Ajax-UpdatePanel-and-JS
is working on a reply...