Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
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
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
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 :)
is working on a reply...
Write your reply to:
Upload image
Image will be uploaded when post is submitted
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
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
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 :)
is working on a reply...