vb.net - Checkboxes in ASP.NET -
i trying use checkbox dynamically declared in .vb file trying write .aspx page. able write normal checkbox of <input type='checkbox />
from .vb class using response.write, comes blank when using <asp:checkbox runat='server' />
i need pass whether or not box checked server, because having either approve if 1 checked, reject if other checked or nothing if neither checked. have figured out how make them mutually exclusive either way not problem. have recommendations?
your problem lies in order pages compiled in: when place asp control asp:checkbox
, compiled regular checkbox javascript attached when sent on client.
when write string "<input type='checkbox />
" page code-behind writing string directly page, after aspx page has compiled controls, since valid html browser renders control. when write asp:checkbox
, browser doesn't know it, because not valid html. in addition, page has been compiled, there no chance of .net creating correct control you.
you need programmatic add control webpage creating new control through code behind
this site great job explaining it
and @toodles seems spot on. writing static html , asp.net 2 totally different ball games. spend bit of time (like hours/days) reading/watching learning material on feet.
Comments
Post a Comment