Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic net diagramming null reference (Read 4621 times)
keropi
YaBB Newbies
*
Offline



Posts: 9
Joined: Oct 3rd, 2008
net diagramming null reference
Oct 3rd, 2008 at 6:36am
Print Post  
Hi, I'm using the full version of this diagramming tool, "ndiag:DiagramView", in a web user control.

when i do a post back, the control gets called first before the actual control's post back does, and at this point, i'll get this stack error. everything in the code behind seems to be loaded properly and i cannot find where this error is coming from.

Your help would be much appreciated.

Thanks.



[NullReferenceException: Object reference not set to an instance of an object.]
   MindFusion.Diagramming.Diagram.LoadFromXml(XmlDocument document) +1789
   MindFusion.Diagramming.WebForms.DiagramView.LoadFromXml(XmlDocument document) +44
   MindFusion.Diagramming.WebForms.DiagramView.LoadFromString(String str) +574
   MindFusion.Diagramming.WebForms.DiagramView.LoadPostData(String postDataKey, NameValueCollection postCollection) +810
   System.Web.UI.Page.ProcessPostData(NameValueCollection postData, Boolean fBeforeLoad) +896
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +2534


  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: net diagramming null reference
Reply #1 - Oct 3rd, 2008 at 10:41am
Print Post  
This worked for me, with postbacks initiated both from within the user control and the containing page.

UserCtrlTest.aspx
Code
Select All
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="UserCtrlTest.aspx.cs" Inherits="UserCtrlTest" %>

<%@ Register Src="WebUserControl.ascx" TagName="WebUserControl" TagPrefix="uc1" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
	<title>Untitled Page</title>
</head>
<body>
	<form id="form1" runat="server">
	<div>
		<input id="Radio1" type="radio" />
		<asp:Button ID="Button1" runat="server" OnClick="Button1_Click" Text="Button" />
		<textarea id="TextArea1" cols="20" rows="2"></textarea>
		<uc1:WebUserControl ID="WebUserControl1" runat="server" />
	</div>
	</form>
</body>
</html>
 



WebUserControl.ascx
Code
Select All
<%@ Control Language="C#" AutoEventWireup="true" CodeFile="WebUserControl.ascx.cs" Inherits="WebUserControl" %>
<%@ Register Assembly="MindFusion.Diagramming.WebForms" Namespace="MindFusion.Diagramming.WebForms"
    TagPrefix="ndiag" %>
<ndiag:diagramview id="DiagramView1" runat="server" height="256px" width="256px"></ndiag:diagramview>
<asp:Button ID="Button1" runat="server" Text="Button" />
 



Could you email your control's code and a page that reproduces the exception to support@mindfusion.eu?
  
Back to top
 
IP Logged
 
keropi
YaBB Newbies
*
Offline



Posts: 9
Joined: Oct 3rd, 2008
Re: net diagramming null reference
Reply #2 - Oct 3rd, 2008 at 11:03am
Print Post  
ok, i've just sent the email,
thanks
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: net diagramming null reference
Reply #3 - Oct 3rd, 2008 at 2:59pm
Print Post  
We have received it. Are you using version 2.0.1?
  
Back to top
 
IP Logged
 
keropi
YaBB Newbies
*
Offline



Posts: 9
Joined: Oct 3rd, 2008
Re: net diagramming null reference
Reply #4 - Oct 3rd, 2008 at 3:05pm
Print Post  
Hi, my MindFusion.Diagramming.dll is version 5.1.0.19866, is that what you're asking for?
  
Back to top
 
IP Logged
 
keropi
YaBB Newbies
*
Offline



Posts: 9
Joined: Oct 3rd, 2008
Re: net diagramming null reference
Reply #5 - Oct 3rd, 2008 at 3:06pm
Print Post  
but the MindFusion.Diagramming.WebForms.dll is version 2.0.1.0
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: net diagramming null reference
Reply #6 - Oct 6th, 2008 at 11:25am
Print Post  
We had to remove most of the 3rd party control references, leaving just a DiagramView within a user control within an UdatePanel within a content page. Postback worked fine in that situation. Could you try removing all controls other than Netdiagram and the standard ASP.NET ones, and see if the exception disappears? Or otherwise, please email us all the third party library assemblies so we can try this with your original code?

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