Ok. I solved this myself. Here is the steps I did.
1. Run at server
To access the HTML element as a variable in the C# code, the following value must be placed in the HTML element tag in the aspx file:
runat="server"
Some objects in the Toolbox in the Visual Studio IDE do not automatically include this value when added to the page.
2. Regenerate the auto-generated C# file:
In the Solution Explorer, under the aspx file there is another file *.aspx.cs. Right-click on the parent aspx file. In the pop-up menu, select Convert to Web Application. Click on Build, Build Solution. All the errors are gone.
Now the element should be accessible in the C# code file.