Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic error with updatepanel (Read 5500 times)
hans
Junior Member
**
Offline


I Love MindFusion!

Posts: 81
Location: Netherlands
Joined: Mar 17th, 2012
error with updatepanel
Jan 29th, 2013 at 12:49pm
Print Post  
Don't know if this posting should be at asp.net ?
I have a dot-net 4 webapplication
on the page there is a diagram in canvas-mode
When I use a updatepanel somewhere on the page with some button, I get an error after the postback:
0x800a139e - Runtime-fout Microsoft JScript: Sys.InvalidOperationException: A control is already associated with the element.

In the script the break is on :
if (element.control) throw Error.invalidOperation(Sys.Res.controlAlreadyDefined);

where element = diagramview1
and control seems to be diagram?
Do you have any idea what i'm doing wrong?

This is the code I'm using:

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WebForm2.aspx.cs" Inherits="canvas2.WebForm2" %>
<%@ Register Assembly="MindFusion.Diagramming.WebForms" Namespace="MindFusion.Diagramming.WebForms" TagPrefix="ndiag" %>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <asp:UpdatePanel ID="UpdatePanel1" runat="server">
            <ContentTemplate>
                <asp:Button ID="Button1" runat="server" Text="Button" OnClick="Button1_Click" />
                <asp:ScriptManager ID="ScriptManager1" runat="server">
                </asp:ScriptManager>
            </ContentTemplate>
        </asp:UpdatePanel>
        <ndiag:DiagramView ID="DiagramView1" runat="server" Height="256px" Width="256px" ClientSideMode="Canvas"></ndiag:DiagramView>
    </div>
    </form>
</body>
</html>

using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace canvas2
{
    public partial class WebForm2 : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }

        protected void Button1_Click(object sender, EventArgs e)
        {
             Button1.Text="hello";
        }
    }
}
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: error with updatepanel
Reply #1 - Feb 1st, 2013 at 11:13am
Print Post  
This version should fix the problem:
https://mindfusion.eu/_beta/netdiagram5_canvas.zip

I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint