Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • shufflemoomin 37 posts 36 karma points
    Jun 01, 2010 @ 15:49
    shufflemoomin
    0

    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

  • Tom Maton 387 posts 660 karma points
    Jun 01, 2010 @ 15:58
    Tom Maton
    0

    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

  • Aaron Powell 1708 posts 3046 karma points c-trib
    Jun 01, 2010 @ 15:59
    Aaron Powell
    0

    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.

  • Kresten Banke 36 posts 56 karma points
    Jun 02, 2010 @ 07:52
    Kresten Banke
    0

    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

  • Aaron Powell 1708 posts 3046 karma points c-trib
    Jun 02, 2010 @ 10:24
    Aaron Powell
    0

    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.

  • shufflemoomin 37 posts 36 karma points
    Jun 02, 2010 @ 11:37
    shufflemoomin
    0

    @Kresten Banke: Why are you hijacking my thread and posting as me? What the hell?

    Shufflemoomin

  • shufflemoomin 37 posts 36 karma points
    Jun 02, 2010 @ 11:43
    shufflemoomin
    0

    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

     

  • Kresten Banke 36 posts 56 karma points
    Jun 02, 2010 @ 12:41
    Kresten Banke
    0

    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

Please Sign in or register to post replies

Write your reply to:

Draft