If you have radio buttons that you need to deal with on both the server and the client, well, it becomes sort of ridiculous. You are looking for totally different things on the client as you are at the server.
Anyway, in a recent effort to make some sense of a radio button group that I needed to manipulate at the client, I found myself giving up on asp.net server controls, and just went back to this:
<input clientidmode="Static" value="0" type="radio" runat="server" name="MyButtonGroup" id="MyButton" checked="true" />
clientidmode="static" will prevent asp.net from mucking up the "name" so I can find this group in a useful manner at the client.
Here's the best part.
Intellisense complains about "checked": The values permitted for this attribute do not include "true."
So I change it to "checked" which is the only permitted value.
Now I get a run-time error:
Cannot create an object of type 'System.Boolean' from its string representation 'checked' for the 'Checked' property.
So which way do you want it Microsoft?
Sheesh.
No comments:
Post a Comment