Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. radio button issue in asp.net

radio button issue in asp.net

Scheduled Pinned Locked Moved ASP.NET
csharpasp-netsysadminhelp
4 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • T Offline
    T Offline
    trilokharry
    wrote on last edited by
    #1

    <td> <asp:RadioButton GroupName="Hotel" ID="rbtnSelect" runat="server" ></asp:RadioButton> </td> in below written code in DataList I am using radio button now suppose 3 records are coming but I want to check any one radio button only but right now It is allowing multiple checked. <asp:DataList ID="DataHotel" runat="server" Width="100%" CellPadding="0" CellSpacing="0"> <HeaderTemplate> <table width="100%" style="background-color: #f5f4f4"> <tr> <td colspan="4" style="background-color: #b5f0a0; font-size: 15px"> Hotels</td> </tr> <tr> <td></td> <td> <b>Hotel Name</b></td> <td> <b>Lowest Average Rate</b></td> <td> <b>Highest Average Rate</b></td> </tr> </HeaderTemplate> <ItemTemplate> <tr> <td> <asp:RadioButton GroupName="Hotel" ID="rbtnSelect" runat="server" ></asp:RadioButton> </td> <td> <%# Eval("HotelName") %> <asp:HiddenField ID="hdnNAME" runat="server" Value='<%# Eval("hotelID") %>' /> </td> <td> <%# Eval("lowestavgprice")%> </td> <td> <%# Eval("Highestavgprice")%> </td> </tr> </ItemTemplate> <FooterTemplate> </table> </FooterTemplate> </asp:DataList>

    You get the best out of others when you give the best of yourself.

    A P 2 Replies Last reply
    0
    • T trilokharry

      <td> <asp:RadioButton GroupName="Hotel" ID="rbtnSelect" runat="server" ></asp:RadioButton> </td> in below written code in DataList I am using radio button now suppose 3 records are coming but I want to check any one radio button only but right now It is allowing multiple checked. <asp:DataList ID="DataHotel" runat="server" Width="100%" CellPadding="0" CellSpacing="0"> <HeaderTemplate> <table width="100%" style="background-color: #f5f4f4"> <tr> <td colspan="4" style="background-color: #b5f0a0; font-size: 15px"> Hotels</td> </tr> <tr> <td></td> <td> <b>Hotel Name</b></td> <td> <b>Lowest Average Rate</b></td> <td> <b>Highest Average Rate</b></td> </tr> </HeaderTemplate> <ItemTemplate> <tr> <td> <asp:RadioButton GroupName="Hotel" ID="rbtnSelect" runat="server" ></asp:RadioButton> </td> <td> <%# Eval("HotelName") %> <asp:HiddenField ID="hdnNAME" runat="server" Value='<%# Eval("hotelID") %>' /> </td> <td> <%# Eval("lowestavgprice")%> </td> <td> <%# Eval("Highestavgprice")%> </td> </tr> </ItemTemplate> <FooterTemplate> </table> </FooterTemplate> </asp:DataList>

      You get the best out of others when you give the best of yourself.

      A Offline
      A Offline
      Abhijit Jana
      wrote on last edited by
      #2

      just give the grupname same to all

      cheers, Abhijit

      T 1 Reply Last reply
      0
      • A Abhijit Jana

        just give the grupname same to all

        cheers, Abhijit

        T Offline
        T Offline
        trilokharry
        wrote on last edited by
        #3

        It is not like that. I am taking this control once inside DataList and howmany times it will come depends upon no. of records fetching from database. when I am taking groupname="Hotel" then also It's considering separate. thanks

        You get the best out of others when you give the best of yourself.

        1 Reply Last reply
        0
        • T trilokharry

          <td> <asp:RadioButton GroupName="Hotel" ID="rbtnSelect" runat="server" ></asp:RadioButton> </td> in below written code in DataList I am using radio button now suppose 3 records are coming but I want to check any one radio button only but right now It is allowing multiple checked. <asp:DataList ID="DataHotel" runat="server" Width="100%" CellPadding="0" CellSpacing="0"> <HeaderTemplate> <table width="100%" style="background-color: #f5f4f4"> <tr> <td colspan="4" style="background-color: #b5f0a0; font-size: 15px"> Hotels</td> </tr> <tr> <td></td> <td> <b>Hotel Name</b></td> <td> <b>Lowest Average Rate</b></td> <td> <b>Highest Average Rate</b></td> </tr> </HeaderTemplate> <ItemTemplate> <tr> <td> <asp:RadioButton GroupName="Hotel" ID="rbtnSelect" runat="server" ></asp:RadioButton> </td> <td> <%# Eval("HotelName") %> <asp:HiddenField ID="hdnNAME" runat="server" Value='<%# Eval("hotelID") %>' /> </td> <td> <%# Eval("lowestavgprice")%> </td> <td> <%# Eval("Highestavgprice")%> </td> </tr> </ItemTemplate> <FooterTemplate> </table> </FooterTemplate> </asp:DataList>

          You get the best out of others when you give the best of yourself.

          P Offline
          P Offline
          pradeep kumarappagari
          wrote on last edited by
          #4

          http://www.codeproject.com/KB/webforms/GridViewRadiobuttons.aspx[^] this will help u :-O

          Pradeep Reddy

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups