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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T09:37:50+00:00 2026-05-14T09:37:50+00:00

I need to provide a way to allow users to select 1 Subject, but

  • 0

I need to provide a way to allow users to select 1 Subject, but the subjects are grouped into Qualifications and so I want to show a heading for each ‘group’. My first thought is an asp:RadioButtonList as that provides a list of options from which only one can be selected but there’s no means to add break the list up with headings.

So I tried the following code – but I can’t see that the LiteralControl is being added, which makes me think it’s not a valid approach.

For Each item As Subject In Qualifications
    If item.QualCode <> previousQualCode Then
        rblSelection.Controls.Add(New LiteralControl(item.QualName))
    End If

    rblSelection.Items.Add(New ListItem(item.SubjectName, item.SelectionCode))
    previousQualCode = item.QualCode
Next
  • 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-14T09:37:50+00:00Added an answer on May 14, 2026 at 9:37 am

    No you can’t do this. It is only valid to have ListItems. Another approach would be to have a RadioButton for each subject. Give them all the same GroupName which will mean you can only set one, but you can arrange them however you like on the page, under headings, maybe.

        <h3>Qualification 1</h3>
        <asp:RadioButton id="rbSubject" runat="server" />
        <asp:RadioButton id="rbSubject1" runat="server" />
        <asp:RadioButton id="rbSubject2" runat="server" />
        <h3>Qualification 2</h3>
        <asp:RadioButton id="rbSubject3" runat="server" />
        <asp:RadioButton id="rbSubject4" runat="server" />
    

    Code Behind:

            rbSubject.GroupName = "grp1";
            rbSubject1.GroupName = "grp1";
            rbSubject2.GroupName = "grp1";
            rbSubject3.GroupName = "grp1";
            rbSubject4.GroupName = "grp1";
    

    In your case, use a placeholdercontrol and add the dynamically generated controls and headers to the placeholders Controls collection.

    For Each item As Subject In Qualifications
        If item.QualCode <> previousQualCode Then
            placeholder.Controls.Add(New LiteralControl(item.QualName))
        End If
        create new button here:- sorry Im a C# dev, I dont know the VB syntax and I am editing from my phone, but you should be able to work it out.
    
        placeholder.Controls.Add(btn)
        previousQualCode = item.QualCode
    Next
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need to provide our web developers an easy and quick way to test
Is there any way to provide user log-in without the need for a DB.
I need to send email notifications to users and I need to allow the
I want to find a way to allow our reporting guy to export data
I need to provide a window on an ASP.NET MVC web page where registered
I need to provide email sending and receiving capabilities within my java web-application. Think
I need to provide some passwords, API keys and similar sensitive data in my
I am starting research on a project that will need to provide ACID semantics
I have a few large forms that I need to provide visual cues about
I'm currently writing an app in Python and need to provide localization for it.

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.