Welcome Guest Search | Active Topics | Sign In | Register

passing node.getText to a query string in the context menu item of a tree node Options
tresa
Posted: Friday, October 26, 2007 2:12:36 PM
Rank: Newbie
Groups: Member

Joined: 10/12/2007
Posts: 8
Hi,

The context menu is getting the tree node value through node.getText()

//JAVASCRIPT FUNCTION
function ShowContextMenu(e, treeView, node)
{
{
if (node.getLevel() == 2)
{
eo_ShowContextMenu(e, "ContextMenu1");
alert(node.getText());
var node_value=node.getText();

}
else
if(node.getLevel()==3)
eo_ShowContextMenu(e, "ContextMenu2");
}
return true;
}

But I wish to pass this value in the query string "AddStudent.aspx" which is an item in the context menu1


//CODING context menu 1 items

<TopGroup Orientation="Vertical">
<Items>
<eo:MenuItem Text-Html="Add a Student " NavigateUrl="AddStudent.aspx?node_value='"& ?????? &"'" TargetWindow="rbottom" RaisesServerEvent="True" >
</eo:MenuItem>

I know that the javascript variable cannot be passed to a Asp.control...
Then how do I go about ?????? part. I just want the node.value to be passed to the AddStudent.aspx page

Is there any vb.net code similar to the js code for eo_showcontextmenu?

Any help is greatly appreciated

Regards




eo_support
Posted: Friday, October 26, 2007 2:20:20 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,217
Hi,

You won't be able to pass it that way. The easiest way for you is to store the target Url in a global variable, then instead of using NavigateUrl, use ClientSideOnItemClick:

Code: JavaScript
var g_arguments = null;

function ShowContextMenu(e, treeView, node)
{
    //Figure out the arguments based on node
    g_arguments = node.getValue();
} 

function on_context_menu_item_click(e, info)
{
    var url = "AddStudents.aspx?id=" + g_arguments;
    window.open(url, "_self");
}


Code: HTML/ASPX
<eo:ContextMenu  ClientSideOnItemClick="on_context_menu_item_click" ...>
  .....
</eo:ContextMenu>


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.