Forms and controls ID issue

I discovered something weird with VS.net, Intellisense and ID in forms.

If you declare a Radiobutton like

<asp:RadioButton id="D131"  GroupName="D13" runat="server"  Text="" />
<asp:RadioButton id="D132"  GroupName="D13" runat="server"  Text=""/>

etc...

Intellisense show you immediatly if you try to use the same ID in the Radiobutton by an underline under your error, and a compilation error.

But if you look at Groupname, Intellisense don't test that.
You can have a success compilation if you add to the previous lines somewhere else in your page

<asp:checkbox id="D13" runat=server />

And now if you play from your code behind with the ID of the Textbox you are surely going to be in trouble.
I had an error page saying that I can't have duplicate Ids in the same page !

I am not sure where is exactly the issue, but it seem for me obvious now to not using the same Groupname and ID in the same page.

No Comments