I have downloaded a GLEE(Graph Layout Execution Engine) and written the following code to display a windows form from a web page but i am encountering with a small problem on displaying the graph into the display and I am getting the following error when I run the web page.Can anybody solve this problem. I would be very grateful. Thanks
Error:
System.InvalidOperationException: Showing a modal dialog box or form when the application is not running in UserInteractive mode is not a valid operation. Specify the ServiceNotification or DefaultDesktopOnly style to display a notification from a service application.
Code:
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Windows.Forms;
using System.ComponentModel;
using System.Drawing;
using System.Text;
using Microsoft.Glee;
using Microsoft.Glee.Splines;
public partial class Flow : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
//create a form
System.Windows.Forms.Form form = new System.Windows.Forms.Form();
//create a viewer object
Microsoft.Glee.GraphViewerGdi.GViewer viewer = new Microsoft.Glee.GraphViewerGdi.GViewer();
//create a graph object
Microsoft.Glee.Drawing.Graph graph = new Microsoft.Glee.Drawing.Graph("graph");
//create the graph content
graph.AddEdge("A", "B");
graph.AddEdge("B", "C");
graph.AddEdge("A", "C").EdgeAttr.Color = Microsoft.Glee.Drawing.Color.Green;
graph.FindNode("A").Attr.Fillcolor = Microsoft.Glee.Drawing.Color.Magenta;
graph.FindNode("B").Attr.Fillcolor = Microsoft.Glee.Drawing.Color.MistyRose;
Microsoft.Glee.Drawing.Node c = graph.FindNode("C");
c.Attr.Fillcolor = Microsoft.Glee.Drawing.Color.PaleGreen;
c.Attr.Shape = Microsoft.Glee.Drawing.Shape.Diamond;
//bind the graph to the viewer
viewer.Graph = graph;
//associate the viewer with the form
form.SuspendLayout();
viewer.Dock = System.Windows.Forms.DockStyle.Fill;
form.Controls.Add(viewer);
form.ResumeLayout();
//show the form
form.ShowDialog();
}
}