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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T04:12:46+00:00 2026-06-04T04:12:46+00:00

My site has language change control so when a language is clicked I reload

  • 0

My site has language change control so when a language is clicked I reload the same page but with different language text, and if the user has already field in the form I have to reload the data.

I have managed to reload data into checkboxes, textbox but not with radio botton

Please see my code

I have a datalist and a radio button inside.

<asp:DataList runat="server" ID="dlRole">
                <ItemTemplate>
                    <input type="radio" id="rblRole" name="rblRole" value='<%# Eval("RoleCode") %>' />                      
                    <asp:Label ID="lbRole" runat="server" Text='<%# Eval("Description")%>'></asp:Label>
                </ItemTemplate>
            </asp:DataList>

I load the datalist, radio buttons

dlRole.DataSource = ...
dlRole.DataBind();

I save the radio button value into user session object

 user.Role = Request["rblRole"];

but when I reload the saved object into radio button, it cannot find the radio button object control…. radio button is always NULL. and I am not sure why

        foreach (DataListItem item in dlRole.Items)
        {
            HtmlInputRadioButton radio = (item.FindControl("rblRole") as HtmlInputRadioButton);                
            if (radio != null) <--- always nulll
            {
                if (radio.Value == user.Role.ToString())
                {
                  radio.Checked = true;
                }
                else
                  radio.Checked = false;
            }
        }

please let me know how to fix that
thank you

  • 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-04T04:12:47+00:00Added an answer on June 4, 2026 at 4:12 am

    You need to add

    runat="server" 
    

    on you radio button otherwise it will not be accessible from the Code Behind.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Each user of my site has their own profile page, which contains several items
My site has a way of changing its language, and each time I change
My site has several listing pages and on each page, I'd like to enable
My PHP site has header,body,footer files that are included into the INDEX.PHP page. On
I have a one page site that has PHP code in it. Once the
The site I work on has a lot of images that contain text. This
Each article of my site has a unique ID number. When a user clicks
My site has an input box, which has a onkeydown event that merely alerts
My site has a library full of games, nations, game scenarios, etc. library.php is
my site has three div elements, header, content and footer. i have a picture

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.