Profile Picture

onclick shape alert using webform

Posted By Cristianf 10 Years Ago
Author
Message
Cristianf
Question Posted 10 Years Ago
View Quick Profile
Forum Newbie

Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)

Group: Forum Members
Last Active: 9 Years Ago
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 my 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?





Similar Topics


Reading This Topic