Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 190205
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T16:14:11+00:00 2026-05-11T16:14:11+00:00

This is so damn stupid but driving me absolutely fing crazy. <input type=radio name=OptGroup

  • 0

This is so damn stupid but driving me absolutely fing crazy.

<input type="radio" name="OptGroup" id="<%#"rbEmail" + ((Action)Container.DataItem).ID %>" value="<%#((Action)Container.DataItem).ID %>" runat="server" /><label for="<%#"rbEmail" + ((Action)Container.DataItem).ID %>"><%#((Action)Container.DataItem).Action %></label>

What am I doing wrong here! I’ve also tried:

<input type="radio" name="OptGroup" id='<%#"rbEmail" + ((Action)Container.DataItem).ID %>' value='<%#((Action)Container.DataItem).ID %>' runat="server" /><label for='<%#"rbEmail" + ((Action)Container.DataItem).ID %>'><%#((Action)Container.DataItem).Action %></label>

and

<input type="radio" name="OptGroup" id="<%#'rbEmail' + ((Action)Container.DataItem).ID %>" value="<%#((Action)Container.DataItem).ID %>" runat="server" /><label for="<%#'rbEmail' + ((Action)Container.DataItem).ID %>"><%#((Action)Container.DataItem).Action %></label>

I specifically do not want to use an asp.net radiobutton due to the problems with GroupName it creates while inside a repeater. I want to use a bare radio button and bind its values to my datasource.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-11T16:14:11+00:00Added an answer on May 11, 2026 at 4:14 pm

    Do you need to access the control server-side? If not, take off the runat=”server”, you cannot databind to the ID property for a server control. Not sure if thats the problem, since that should give you a different error

    EDIT:

    Something like this should suit your purposes..

    <asp:Repeater runat="server">
        <ItemTemplate>
            <label><input type="radio" name="rbEmail" value='<%# ((Action)Container.DataItem).ID %>' /><%# ((Action)Container.DataItem).Action %></label>
        </ItemTemplate>
    </asp:Repeater>
    

    Then in the postback, you can get the value from Request.Form[“rbEmail”]

    EDIT2:

    Fully tested simple page example..

    Default.aspx

    <%@ Page Language="C#" AutoEventWireup="true"  CodeFile="Default.aspx.cs" Inherits="_Default" %>
    
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head runat="server">
        <title>Untitled Page</title>
    </head>
    <body>
        <form id="form1" runat="server">
            <asp:Repeater ID="Repeater1" runat="server">
                <ItemTemplate>
                    <label><input type="radio" name="rbEmail" value='<%# Container.DataItem %>' /><%# Container.DataItem %></label>
                </ItemTemplate>
            </asp:Repeater>
            <asp:Button ID="submit" runat="server" OnClick="submit_Click" Text="submit" />
        </form>
    </body>
    </html>
    

    Default.aspx.cs

    using System;
    
    public partial class _Default : System.Web.UI.Page 
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            Repeater1.DataSource = new string[] { "Hello", "World" };
            Repeater1.DataBind();
        }
    
        protected void submit_Click(object sender, EventArgs e)
        {
            Response.Write(Request.Form["rbEmail"]);
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I hate ask stupid questions like this, but why doesn't my code do what
I'm trying this simple code, but the damn break doesn't work... what is wrong?
It's a well known issue this damn error expected class-name before ‘{’ token Well,
I was wondering why this code does not work in C++/CLI but damn easy
I have this one working but it is so damn slow on jpeg images
Ok I know this is simple, in fact damn simple, I did this in
I have spent many hours trying to work this damn thing out! so I
This is so damn simple im sure! Im missing something and im exhausted from
http://jsfiddle.net/Lqvcr/53/ This is so damn basic and I have no idea how to make
I was asked this today and i know the answer is damn sure simple

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.