im using treeview in asp.net
treeview like
*parent
@child1
.child2
*parent
.child
if i click child2 after postback the alignment which is in above should not change
but parent1 should be collapsed
if i click child then parent node should be collapsed
im using thi following code
protected void Page_Load(object sender, EventArgs e)
{
if (Session["tvExpandNode1"] != null)
{
TreeView1.FindNode(Session["tvExpandNode1"].ToString()).Expand();
}
}
protected void TreeView1_SelectedNodeChanged(object sender, EventArgs e)
{
if (TreeView1.SelectedNode.Expanded == true)
{
Session["tvExpandNode1"] = TreeView1.SelectedNode.Parent.Parent.Value;
if (strOpenpage == "Report.aspx")
{
OpenNewWindow(strOpenpage);
}
else
{
Response.Redirect(strOpenpage, false);
}
}
}
its just not working properly...pls provide ur valuable infromation........