Control is rendered if it consists of not server controls, but simple HTML tags for example <button></button> , but if <asp:button/> , then no ...
2 answers
I figured it out, just <asp:button/> need <asp:form runat="server"/> form, since <asp:button/> is the submit element and for render<asp:form runat="server"> <asp:button/> </asp:form> generated
<div class="aspNetHidden"> <input type="hidden" name="__VIEWSTATE" id="__VIEWSTATE" value="/...PGU=" /> </div> <button></button> it turns out that when you submit, you need information about the cantols croning in __VIEWSTATE.
but if you do this then all the same it does not render as the protection for the Page EnableEventValidation = true page is default, if you set the value to false then the page will be rendered but it is written in MSDN that you shouldn’t do that.
Well, if you use other asp: controls, it is rendered without problems !!!
- Note that __VIEWSTATE is generated one per page if there is at least one Web control. Validation of controls occurs if validators are created on the page. - Modus
I recommend that you create Web pages not from scratch, but using Visual Studio templates.