L
Luis Esteban Valencia Muñoz
I have a DataList, which looks a bit like this:
<aspataList id="dlstCheeseType" runat="server"
RepeatColumns="4" RepeatDirection="Horizontal"
ShowHeader="False" ShowFooter="False"
ItemStyle-VerticalAlign="Top" ItemStyle-HorizontalAlign="Center"
ItemStyle-Width="25%" Width="100%">
<ItemTemplate>
<asp:RadioButton ID="cheeseChoice" Text='<%#
Container.DataItem.Row("CheeseName") %>' Runat="server"
GroupName="cheeseGroup"/>
<br>
<asp:Image id=imgCheese Runat="server"
ImageUrl='<%# "Images/" & Container.DataItem.Row("CheeseImg") %>'
Width="100px" Height="100px">
</asp:Image>
</ItemTemplate>
</aspataList>
(sorry for the formatting )
Basically it's filled with a bunch of choices from the database, with a Name
and a graphic. The user should be able to choose one of them using the radio
button (that doesn't work properly, but that's a different question ).
My question:
How can I add something to allow the user to click on the images and
activate the RadioButtons that way? (preferably something client-side, i.e.
without posting the full form to the server)
Thanks!
<aspataList id="dlstCheeseType" runat="server"
RepeatColumns="4" RepeatDirection="Horizontal"
ShowHeader="False" ShowFooter="False"
ItemStyle-VerticalAlign="Top" ItemStyle-HorizontalAlign="Center"
ItemStyle-Width="25%" Width="100%">
<ItemTemplate>
<asp:RadioButton ID="cheeseChoice" Text='<%#
Container.DataItem.Row("CheeseName") %>' Runat="server"
GroupName="cheeseGroup"/>
<br>
<asp:Image id=imgCheese Runat="server"
ImageUrl='<%# "Images/" & Container.DataItem.Row("CheeseImg") %>'
Width="100px" Height="100px">
</asp:Image>
</ItemTemplate>
</aspataList>
(sorry for the formatting )
Basically it's filled with a bunch of choices from the database, with a Name
and a graphic. The user should be able to choose one of them using the radio
button (that doesn't work properly, but that's a different question ).
My question:
How can I add something to allow the user to click on the images and
activate the RadioButtons that way? (preferably something client-side, i.e.
without posting the full form to the server)
Thanks!