Solved

Radio Button List

Posted on 2013-01-23
3
483 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
3 Comments
 
LVL 24

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
ISS migration from IIS 6 to IIS 8.5 rendering problems 4 50
Registering DLL 5 43
Name space syntax error 12 40
Syntax error 9 45
Preface In the first article: A Better Website Login System (http://www.experts-exchange.com/A_2902.html) I introduced the EE Collaborative Login System and its intended purpose. In this article I will discuss some of the design consideratio…
Browsers only know CSS so your awesome SASS code needs to be translated into normal CSS. Here I'll try to explain what you should aim for in order to take full advantage of SASS.
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).

911 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

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now