c# control names

前端 未结 4 1095
小鲜肉
小鲜肉 2021-01-25 17:01

Is there a way to control how .Net sets the Name and ID property of my controls? I have some radio buttons for which I need the name to be the same.

4条回答
  •  攒了一身酷
    2021-01-25 17:31

    Doesn't work quite like that in .net. They need to be uniquely named because that's how they correlate the radio button back to viewstate. I would ask why you need them to be the same name? If it's because you want the user to only be able to select 1 item out of x, then you want to use the GroupName property.

提交回复
热议问题