I'm writing a web application in asp.net using visual basic and I have the following div tag defined. I also have another div tag in the same position overlaying this one, so at certain points I want to make this div tag hidden. I need to do this from the aspx.vb file associated with this page. I've declared the div tag as runat="server" as follows:
<div id="runtestschoices" runat="server">
<asp:CheckBoxList ID="CheckBoxList1" runat="server" CellPadding="0"
<asp:ListItem Selected="True">Extract fields</asp:ListItem>
This is the code I'm using in my aspx.vb file
Dim runtestschoices As HtmlGenericControl
runtestschoices.Visible = False
But at the 2nd line I get the following error 'Object reference not set to an instance of an object.'
Can someone tell me exactly how to hide/show div tags on my aspx page from the code behind the page?