Copied to clipboard

Flag this post as spam?

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


  • Simone Chiaretta 134 posts 541 karma points c-trib
    Nov 14, 2012 @ 19:10
    Simone Chiaretta
    0

    Javascript in custom data editor is called twice

    Hi,

    I created a new data type and set the data editor to the control wrapper.

    Then in the user control, ascx part, I needed to run some javascript to build the UI of the editor, and I noticed the js functions were called twice.

    So as debugging I removed all my code and just added a alert message.

     

    <%@ Control Language="C#" AutoEventWireup="true" CodeBehind="ClassificationBackedTaggingControl.ascx.cs" Inherits="TaggingUserControl.ClassificationBackedTaggingControl" %>

    <asp:textbox ID="Tags" runat="server"></asp:textbox>

    <script>
    alert("Hello");
    </script>

     

    When I load the content node, the message box appears twice...

    any idea of how that could happen? How can I prevent it from happening?

    Thank you

    Simone

  • Jonatan 2 posts 22 karma points
    Nov 15, 2012 @ 13:42
    Jonatan
    0

    Hi Simone,

    I've added your control into an empty Umbraco instance and I cannot reproduce your problem.  In my installation, it works as expected: just one alert message.

    Best,

    Jonatan

  • Simone Chiaretta 134 posts 541 karma points c-trib
    Nov 15, 2012 @ 13:45
    Simone Chiaretta
    0

    Yeah, I know... I should have closed the comment....

    I added my mistake two fields using the same date editor... in two separate tabs, that's why it was triggered twice :)

Please Sign in or register to post replies

Write your reply to:

Draft