Solved

give groupname of radio button inside repeter

Posted on 2012-03-13
1
316 Views
Last Modified: 2012-03-19
Hello Experts,
   i am facing some problem in giving group name of radio button that is inside repeter please provide me the solutions that how can i do that


Below is the sample code
 <asp:Repeater ID="Repeater1" runat="server">
                                                  <HeaderTemplate>
                                                  <table width="100%" border="0" cellspacing="0" cellpadding="0">
                                                  <tr>
                                                    <td width="4%">&nbsp;</td>
                                                    <td width="13%" class="workshop-text"><span class="bold">DATES</span></td>
                                                    <td width="11%" class="workshop-text"><span class="bold">CITY</span></td>
                                                    <td width="15%" class="workshop-text"><span class="bold">LANGUAGE</span></td>
                                                    <td width="30%" class="workshop-text"><span class="bold">VENUE (Click for details)</span></td>
                                                    <td width="27%" class="workshop-text"><span class="bold">FEES</span></td>
                                                  </tr>
                                                  </HeaderTemplate>
                                                    <ItemTemplate>
                                                  <tr>
                                                    <td colspan="6" height="7"></td>
                                                  </tr>
                                                  <tr>
                                                    <td>
                                                       <asp:RadioButton ID="rbworkshop" runat="server" GroupName="rbworkshop1" />
                                                    </td>
                                                    <td class="workshop-detail">
                                                        <asp:Label ID="lbldate1" runat="server" Text='<%#Eval("FromDate","{0:MMM-dd}")+" "+Eval("ToDate","{0:MMM-dd}") %>'></asp:Label>
                                                    </td>
                                                    <td class="workshop-detail">
                                                        <asp:Label ID="lblcity" runat="server" Text='<%#Eval("city") %>'></asp:Label>
                                                    </td>
                                                    <td class="workshop-detail">
                                                        <asp:Label ID="lbllanguage" runat="server" Text='<%#Eval("Language") %>'></asp:Label>
                                                    </td>
                                                    <td class="workshop-detail">
                                                        <asp:Label ID="lblvenue" runat="server" Text='<%#Eval("Venue") %>'></asp:Label>
                                                    </td>
                                                    <td class="workshop-detail">Rs.
                                                    <asp:Label ID="lblfee" runat="server" Text='<%#Eval("Fees","{0:0.00}") %>'></asp:Label>
                                                    </td>
                                                  </tr>
                                                  </ItemTemplate>
                                                  <FooterTemplate>
                                                       <tr>
                                                            <td colspan="6" height="7"></td>
                                                       </tr>
                                                  </table>
                                                  </FooterTemplate>
                                                  </asp:Repeater>
0
Comment
Question by:dotsandcoms
1 Comment
 
LVL 22

Accepted Solution

by:
Mrunal earned 375 total points
ID: 37714740
GroupName property doesn't work as expected when used in a Repeater for radio buttons.

For server side controls (asp radio button) you have to do manually grouping.
I will suggest that instead of server side code, use simple html control. like this:

<input type="radio" name="rbworkshop" value='<%#Eval("CustomerNumber") %>' />

For postback, you can get the value from Request.Form("rbworkshop").

OR

for server side radio buttons, you have to manually set single radio button as selected by JavaScript function.

check this for more:

http://stackoverflow.com/questions/4030155/radio-button-list-in-repeater-control
0

Featured Post

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

Just a quick little trick I learned recently.  Now that I'm using jQuery with abandon in my asp.net applications, I have grown tired of the following syntax:      (CODE) I suppose it just offends my sense of decency to put inline VBScript on a…
This article discusses the ASP.NET AJAX ModalPopupExtender control. In this article we will show how to use the ModalPopupExtender control, how to display/show/call the ASP.NET AJAX ModalPopupExtender control from javascript, how to show/display/cal…
This tutorial demonstrates a quick way of adding group price to multiple Magento products.
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

707 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now