Click to See Complete Forum and Search --> : null object


stevehoang
October 23rd, 2002, 11:59 AM
How can I validate the object before accessing it? The IsNull is not available under asp .net version.

I try to see if the treenode exist in the treeview or not.

Here is my code:

dim userNode as TreeNode = TreeViewInbound.GetNodeFromIndex (strUser)

Thanks for the information

stevehoang
October 23rd, 2002, 12:35 PM
Damm,
I got it!!!. It suppose to be

if (treeNode is Nothing) then
...
end if

instead of
if (treeNode = Nothing) then
...
end if