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";
}
}
}