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 8385231
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T17:37:02+00:00 2026-06-09T17:37:02+00:00

I have a repeater control, and inside it I have two radio buttons selecting

  • 0

I have a repeater control, and inside it I have two radio buttons selecting Sex (male, female).
When I save the page, I save the selected value, either “M” or “F”, into the data. When I load the page, I want the radio button to be selected based on what’s saved.

So, in this case, my repeater has (Container.DataItem).Sex, which equals ‘M’ or ‘F’. How can I use this data in my radiobuttons to select the appropriate value?

This is the kind of function I’d like to use (but it doesn’t exist):

<asp:RadioButtonList runat="server" SelectedValue='<%# ((Dependent)(Container.DataItem)).Sex %>' />

Please note that I am unable to manipulate the radio buttons in the codebehind because I do not have access to the individual repeater items.

  • 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-06-09T17:37:03+00:00Added an answer on June 9, 2026 at 5:37 pm

    What you need to do is use 2 RadioButton control (1 for Female, 1 for Male).

    Then specify the GroupName in order to unselect one when the other is selected.
    Let’s say GroupName="Sex".

    Then specify when each control should be checked according to your DataItem:

    <asp:RadioButton ID="radioMale" runat="server" GroupName="Sex" Checked="<%# ((Dependent)(Container.DataItem)).Sex == 'M' %>" />
    <asp:RadioButton ID="radioFemale" runat="server" GroupName="Sex" Checked="<%# ((Dependent)(Container.DataItem)).Sex == 'F' %>" />
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have user control inside a page with single repeater. The problem is when
I have a DropDownList inside a repeater control in an ASP.NET page that has
Inside my Content page I have a repeater control, which contains multiple controls along
I have a Linkbutton inside a Repeater control. My code in the aspx page
I have one control named thumbviewer inside repeater. I want to set its imageurl
I have a user control nested in a repeater. Inside my user control I
I have a Repeater control in my aspx page: <asp:Repeater ID=repeater runat=server EnableViewState=false> <ItemTemplate>
I have an image control inside a repeater. I would like to exclude/ignore a
I have an aspx page with repeater control on it used for showing the
I have a user control with linkbuttons (used for paging) and a repeater inside

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.