Solved

Radio Button List

Posted on 2013-01-23
3
488 Views
Last Modified: 2013-01-24
I am using a radio button list to be able to send a string to a process so that a site gets created with the proper string.  I need a radio button list that has the following in it:

projects
claims
sites

I did in fact create a radio button list that has the list of things above, but I am concerned that it is not pulling the proper string in code to use.  Here is what I have in my asp:radiobuttonlist:

<asp:RadioButtonList ID="rblContentType" runat="server"
                style="margin-left:400px; margin-top:-22px;" RepeatDirection="Horizontal"
                ValidationGroup="SiteNameValidate">
                <asp:ListItem Value ="projects" Text="projects"></asp:ListItem>
                <asp:ListItem Value="claims" Text="claims"></asp:ListItem>
                <asp:ListItem Value="sites" Text="sites"></asp:ListItem>
             </asp:RadioButtonList>

How would I pull the proper value for what is selected in my code?  I have the following:

 string siteoptionname = rblContentType.SelectedItem.Text;

Is this correct?  If a user selects projects, I want "projects" string to be used, if the user selects "claims" I want claims to be used and if a user selects sites, I want the string "sites" to be used.
0
Comment
Question by:VBBRett
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 25

Expert Comment

by:chaau
ID: 38812757
Looks ok. What happens when you run the program? Do you get unexpected values?
0
 
LVL 19

Accepted Solution

by:
Rikin Shah earned 500 total points
ID: 38814519
Hi,

string siteoptionname = rblContentType.SelectedValue; should do the thing!
0

Featured Post

PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

I will show you how to create a ASP.NET Captcha control without using any HTTP HANDELRS or what so ever. you can easily plug it into your web pages. For Example a = 2 + 3 (where 2 and 3 are 2 random numbers) Session("Answer") = 5 then we…
SASS allows you to treat your CSS code in a more OOP way. Let's have a look on how you can structure your code in order for it to be easily maintained and reused.
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.
The viewer will receive an overview of the basics of CSS showing inline styles. In the head tags set up your style tags: (CODE) Reference the nav tag and set your properties.: (CODE) Set the reference for the UL element and styles for it to ensu…

734 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question