TreeView help [modified]
-
Hey all, I am fairly new to the asp.net world and so far i am missing C# fully capabilities and control. But since i want to learn how to create OS Independent solutions i want to try it out. Could anyone help me with this: 1-) How can i display a message box? In java script i know i can use alert, prompt and confirm. But i am using C# scripts... and some asp books i have doesn't have it. 2-) I have a treeView control on the website but i want to collapse all elements but the selected node, i am doing like this: protected void TreeVIEW_SelectedNodeChanged(object sender, EventArgs e) { TreeView Current = (TreeView)sender; TreeNodeCollection childs = Current.SelectedNode.ChildNodes; Current.SelectedNode.CollapseAll(); foreach (TreeNode child in childs) if (child.Parent == Current.SelectedNode) child.Parent.Expand(); else child.Parent.Collapse(); } what am i doing wrong??? thx all
Luis E Tineo S
modified on Thursday, February 07, 2008 1:59:38 PM
-
Hey all, I am fairly new to the asp.net world and so far i am missing C# fully capabilities and control. But since i want to learn how to create OS Independent solutions i want to try it out. Could anyone help me with this: 1-) How can i display a message box? In java script i know i can use alert, prompt and confirm. But i am using C# scripts... and some asp books i have doesn't have it. 2-) I have a treeView control on the website but i want to collapse all elements but the selected node, i am doing like this: protected void TreeVIEW_SelectedNodeChanged(object sender, EventArgs e) { TreeView Current = (TreeView)sender; TreeNodeCollection childs = Current.SelectedNode.ChildNodes; Current.SelectedNode.CollapseAll(); foreach (TreeNode child in childs) if (child.Parent == Current.SelectedNode) child.Parent.Expand(); else child.Parent.Collapse(); } what am i doing wrong??? thx all
Luis E Tineo S
modified on Thursday, February 07, 2008 1:59:38 PM
kingletas wrote:
But i am using C# scripts
Well, that just doesn't work. Javascript, not C#, is what runs on the client. So to show the client a message box, you need to use javascript.
Christian Graus - Microsoft MVP - C++ "also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )