Most likely you are populating your treenodes in Page_Load and you are not
checking whether the page is posting back.
Page_Load fires every time the page loads (even on postbacks).
The solution to this is - in Page_Load check to see if the page has posted
back and if it is posting back then don't populate the treelist (because it's
already been populated)
so (assuming you were using data binding)
Page_Load(....)
{
if (IsPostBack==false)
{
TreeView.DataBind();
// or
PopulateTreeView();
}
}
in vb.net it would be
if IsPostback=false then
....
end if
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.