Nevron Forum
Back
Login
Register
Login
Register
Home
»
Nevron Vision for NET
»
Nevron Diagram for .NET
»
onclick shape alert using webform
onclick shape alert using webform
Post Reply
onclick shape alert using webform
View
Flat Ascending
Flat Descending
Threaded
Options
Subscribe to topic
Print This Topic
Goto Topics Forum
Author
Message
Cristian Cojocaru
Cristian Cojocaru
posted 11 Years Ago
ANSWER
Topic Details
Group: Forum Members
Posts: 14,
Visits: 24
Hi all,
as I mentioned in my last topic I'm new to Nevron and I'm
trying to understand its potential into m
y future software.
What I'm trying to achieve is to display a popup when clicking on a shape in the NDrawingView component
.
For the click event I used a nice example in the knowledge base like reference, link:
http://support.nevron.com/KB/a209/implement-click-double-click-events-the-diagram-aspnet.aspx
In the AsyncClick event I tried to call a javascript function to display a simple alert, afterwards I will add a nice popup window using jquery so I would like to achieve something like this:
http://jqueryui.com/dialog/#animated
So my source code for the simple javascript alert is:
protected void Page_Load(object sender, EventArgs e)
{
// create a new persistency manager
NPersistencyManager persistencyManager = new NPersistencyManager();
// load a drawing from a file
NDrawingDocument drawing = persistencyManager.LoadDrawingFromFile("C:\\example.ndx");
// display the document into the view
NDrawingView1.Document = drawing;
}
protected void NDrawingView1_AsyncClick(object sender, EventArgs e)
{
ScriptManager.RegisterStartupScript(this, typeof(string), "open", "test();", true);
}
protected void NDrawingView1_QueryAjaxTools(object sender, EventArgs e)
{
NDrawingView1.AjaxTools.Add(new NAjaxMouseClickCallbackTool(true));
}
And this is my page source:
<%@ Control Language="C#" .... %>
<%@ Register assembly="Nevron.Diagram.WebForm, .....%>
<ndwc:NDrawingView ID="NDrawingView1" runat="server" Height="273px" OnAsyncClick="NDrawingView1_AsyncClick" Width="466px" AjaxEnabled="True" AsyncCallbackTimeout="10000" OnQueryAjaxTools="NDrawingView1_QueryAjaxTools" AjaxScriptBuild="Debug">
</ndwc:NDrawingView>
<br />
<p>
<script>
function test() {
alert("ok");
}
</script>
Obviously I added the other code in the webconfig and the dll references, I will not copy all code here for space reasons...
The async click event works great if I riproduce the example from the knowledge base (
http://support.nevron.com/KB/a209/implement-click-double-click-events-the-diagram-aspnet.aspx)
but it doesn't when trying to call the javascript function
... I used the debugger but it doesn't trigger errors, any help?
Reply
Like
0
GO
Merge Selected
Merge into selected topic...
Merge into merge target...
Merge into a specific topic ID...
Open Merge
Threaded View
Threaded View
onclick shape alert using webform
Cristian Cojocaru 1
-
11 Years Ago
I didn't found a solution yet :( But I've seen an example of mouse...
Cristian Cojocaru 1
-
11 Years Ago
Hi, We recommend you migrate your project to the thin web diagram...
Nevron Support
-
11 Years Ago
Beautiful! It worked with thin web component! Thank you very much.
Cristian Cojocaru 1
-
11 Years Ago
Post Reply
Similar Topics
Post Quoted Reply
Reading This Topic
Login
Login
Remember Me
Reset Password
Resend Validation Email
Login
Explore
Messages
Mentions
Search