H
haiwen
Hello, everyone:
I am using Microsoft treeview control, I dynamically load all of nodes in
Page_load,
if I set the EnableViewState is true (default setting), when I click another
server control, even do nothing and just postback, I always get follow error
no matter I load the nodes all the time ( not just in !IsPostBack) in
Page_Load.
if I set the EnableViewState is false, it works fine when I load the nodes
all the time in Page_load.
I prefer, just like other web controls, that load the nodes one time
(!ispostback) and set EnableViewState is true.
could anyone help me out? Thanks a lot.
haiwen
[ArgumentOutOfRangeException: Specified argument was out of the range of
valid values.
Parameter name: Index was out of range. Must be non-negative and less than
the size of the collection.]
System.Collections.CollectionBase.System.Collections.IList.get_Item(Int32
index) +199
Microsoft.Web.UI.WebControls.BaseChildNodeCollection.System.Web.UI.IStateManager.LoadViewState(Object state)
Microsoft.Web.UI.WebControls.TreeView.LoadViewState(Object savedState)
System.Web.UI.Control.LoadViewStateRecursive(Object savedState)
System.Web.UI.Control.LoadViewStateRecursive(Object savedState)
System.Web.UI.Control.LoadViewStateRecursive(Object savedState)
System.Web.UI.Control.LoadViewStateRecursive(Object savedState)
System.Web.UI.Page.LoadPageViewState()
System.Web.UI.Page.ProcessRequestMain() +423
I am using Microsoft treeview control, I dynamically load all of nodes in
Page_load,
if I set the EnableViewState is true (default setting), when I click another
server control, even do nothing and just postback, I always get follow error
no matter I load the nodes all the time ( not just in !IsPostBack) in
Page_Load.
if I set the EnableViewState is false, it works fine when I load the nodes
all the time in Page_load.
I prefer, just like other web controls, that load the nodes one time
(!ispostback) and set EnableViewState is true.
could anyone help me out? Thanks a lot.
haiwen
[ArgumentOutOfRangeException: Specified argument was out of the range of
valid values.
Parameter name: Index was out of range. Must be non-negative and less than
the size of the collection.]
System.Collections.CollectionBase.System.Collections.IList.get_Item(Int32
index) +199
Microsoft.Web.UI.WebControls.BaseChildNodeCollection.System.Web.UI.IStateManager.LoadViewState(Object state)
Microsoft.Web.UI.WebControls.TreeView.LoadViewState(Object savedState)
System.Web.UI.Control.LoadViewStateRecursive(Object savedState)
System.Web.UI.Control.LoadViewStateRecursive(Object savedState)
System.Web.UI.Control.LoadViewStateRecursive(Object savedState)
System.Web.UI.Control.LoadViewStateRecursive(Object savedState)
System.Web.UI.Page.LoadPageViewState()
System.Web.UI.Page.ProcessRequestMain() +423