Value of type 'System.Web.UI.Control' cannot be converted to 'System.Web.UI.WebControls.TreeNode' !!
Posted on 2008-06-11
I have the following:
Request("Id") => Which represents the ID of the TreeNode.
I want to get the TreeNode from this. I have used the following syntax but never works for me:
Dim node As TreeNode = CType(FindControl(Request("Id")), TreeNode)
Value of type 'System.Web.UI.Control' cannot be converted to 'System.Web.UI.WebControls.TreeNode'
Can you please give me the correct syntax ?