R – ASP.Net – Tree view control

asp.nettreeview

I am using visual basic for coding. I drag & dropped a tree view control and edited its nodes.
Now when I run my page I get this error->

Control 'TreeView1' of type 'TreeView' must be placed inside a form tag with runat=server.

In the source I have the following entry

asp:TreeView ID="TreeView1" runat="server" Height="155px" Style="z-index: 100; left: 41px;
position: absolute; top: 108px" Width="1px" ImageSet="Contacts" NodeIndent="10"

Best Answer

Just place a form on the page:

so just inside the body tags add:

<body>
<form id="MainForm" runat="server">

... your form controls, including the treeview

</form>
</body>