I have this function:
protected void mytv_SelectedNodeChanged(object sender, EventArgs e)
{
TreeView tv = sender as TreeView;
var nid = tv.SelectedNode.Value;
ScriptManager.RegisterStartupScript(this, this.GetType(), "anyname", "show(nid)", true);
}
As you can see, I have a variable nid that gets different value as 1,2,3 according to the treenode clicked.
Can i pass that nid variable value directly as a parameter to the javascript function as show(nid)?
If not what do i do?
My javascript function is as follows:
function show(nid)
{
if (nid == 4) {
alert('testing');
}
else
{
alert('what???');
}
}