the first thing is that all controls must be enclosed within the <form> tag of asp.net, thats the first requirement. so your form code must look something like this
<form id="formiId" runat="server">
your code here ...
I presume your other error might go with the code coming inside the form, if no then re-post so that we can check on the error specifically.