Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic LinkCreated firing again on postback (Read 2326 times)
jcollins@scires
Junior Member
**
Offline


I love YaBB 1G - SP1!

Posts: 53
Joined: Feb 17th, 2009
LinkCreated firing again on postback
Feb 23rd, 2009 at 3:33pm
Print Post  
Hello, I have server side code within the LinkCreated event. It gets executed fine after the link is created. Yet, if you postback again after the link has been created, the event fires again. I am not sure why this is happening. Below is my code:
aspx:
<%@ Page Language="VB" AutoEventWireup="false" CodeFile="Default3.aspx.vb" Inherits="Default3" %>
<%@ Register Assembly="MindFusion.Extenders" Namespace="MindFusion.Diagramming.WebForms"
    TagPrefix="cc1" %>

<%@ Register Assembly="MindFusion.Diagramming.WebForms" Namespace="MindFusion.Diagramming.WebForms"
    TagPrefix="ndiag" %>
   
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>Untitled Page</title>
</head>
<body>
    <form id="form1" runat="server">
       <asp:ScriptManager ID="ScriptManager1" runat="server" />
       <div>
           <asp:UpdatePanel ID="UpdatePanel1" runat="server">
               <ContentTemplate>
                   <table style="table-layout:fixed;">
                       <tr>
                           <td style="width:740px">
                               <ndiag:DiagramView ID="diagView"  AutoScroll="true"  runat="server" Height="480px" Width="740px" ClientSideMode="ImageMap" >
                                   <Diagram AllowSelfLoops="false" />
                               </ndiag:DiagramView>
                           </td>
                           <td style="vertical-align:top;">
                               <ndiag:Overview ID="ovw" runat="server" DiagramViewID="diagView" Style="left: 680px; width: 120px;
                               top: 320px; height: 160px; display:inline;" />
                           </td>
                       </tr>
                   </table>
                   <cc1:InteractivityExtender ID="InteractivityExtender1" TargetControlID="diagView" runat="server" />
                   <cc1:OverviewExtender ID="ovrExt" TargetControlID="ovw" runat="server" />
               </ContentTemplate>
           </asp:UpdatePanel>
           <asp:Button ID="btnPostBack" runat="server" Text="Postback" />
      </div>
    </form>
</body>
</html>




when I click on btnPostBack, the event fires again and I don't want it to since it has already fired.

Thanks.
Jay
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: LinkCreated firing again on postback
Reply #1 - Feb 23rd, 2009 at 4:01pm
Print Post  
Hi,

Seems some hidden fields are not cleared when reloading from an update panel. As a workaround you could set the value of _mfusion_diagView_ClickedItem to an empty string from the onload handler until we fix it.

Stoyan

edit: you should also clear the value of _mfusion_diagView_Ajax.
  
Back to top
 
IP Logged
 
jcollins@scires
Junior Member
**
Offline


I love YaBB 1G - SP1!

Posts: 53
Joined: Feb 17th, 2009
Re: LinkCreated firing again on postback
Reply #2 - Feb 23rd, 2009 at 5:27pm
Print Post  
Thanks for the quick response. I tried the following workaround script below but it still seems to fire twice.

<script type="text/javascript" language="javascript">
           Sys.Application.add_load(loadHandler)
           function loadHandler() 
          { 
               _mfusion_diagView_ClickedItem='';
               _mfusion_diagView_Ajax='';
          }
       </script>
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: LinkCreated firing again on postback
Reply #3 - Feb 24th, 2009 at 9:03am
Print Post  
Hi,

These are HIDDEN html elements, and you should set their value attribute, e.g.:

Code
Select All
field = $get('_mfusion_diagView_ClickedItem');
field.value = '';
field = $get('_mfusion_diagView_Ajax');
field.value = '';
 



Anyway we'll upload the fixed version in a couple of days.

Stoyan
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint