Profile Picture

Problem with Ajax Async Click and Redirect

Posted By Anna Lear 15 Years Ago
Author
Message
Anna Lear
Posted 15 Years Ago
View Quick Profile
Junior Member

Junior Member (12 reputation)Junior Member (12 reputation)Junior Member (12 reputation)Junior Member (12 reputation)Junior Member (12 reputation)Junior Member (12 reputation)Junior Member (12 reputation)Junior Member (12 reputation)Junior Member (12 reputation)

Group: Forum Members
Last Active: 14 Years Ago
Posts: 12, Visits: 1
I'm trying to set up an auto-redirect when the user clicks on a diagram element. It's mostly working fine, except for a couple connector elements. When I click on those, I end up redirected to a wrong page.

I have the drawing view set up this way:
<ndwc:NDrawingView ID="NDrawingView1" runat="server" Height="529px" Width="738px" BorderStyle="None" EnableTheming="false" AjaxEnabled="True" OnQueryAjaxTools="NDrawingView1_QueryAjaxTools"></ndwc:NDrawingView>

Then I have a method on the page that displays the diagram that sets the interactivity style on the shapes:
foreach (NShape node in NDrawingView1.Document.ActiveLayer.Children(new NInstanceOfTypeFilter(typeof(NShape))))
{
var interactivityStyle = new NInteractivityStyle {
GenerateImageMapObject = true,
UrlLink =
new NUrlLinkAttribute(@"/OtherPage.aspx?SelectedElement=" +
Server.HtmlEncode(node.Name), false)
};
node.Style.InteractivityStyle = interactivityStyle;
}

And finally, the contents of the QueryAjaxTools handler:
protected void NDrawingView1_QueryAjaxTools(object sender, EventArgs e)
{
NDrawingView1.AjaxTools.Add(new NAjaxMouseClickCallbackTool(true, true));
NDrawingView1.AjaxTools.Add(new NAjaxRedirectTool(true));
}

I have verified that the diagram itself is valid and the element clicks has the correct InteractivityStyle set, with the correct URL.

However, let's say the problem element's name is A. Some other element on the diagram is called B. Where I expect to end up at OtherPage.aspx?SelectedElement=A, I am instead redirected to OtherPage.aspx?SelectedElement=B.

Are there any particular spots I should check to try and figure out what's going on? The diagram? My code?

Thanks.




Similar Topics


Reading This Topic