VBBRett
asked on
Radio Button List
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="Horizonta l"
ValidationGroup="SiteNameV alidate">
<asp:ListItem Value ="projects" Text="projects"></asp:List Item>
<asp:ListItem Value="claims" Text="claims"></asp:ListIt em>
<asp:ListItem Value="sites" Text="sites"></asp:ListIte m>
</asp:RadioButtonList>
How would I pull the proper value for what is selected in my code? I have the following:
string siteoptionname = rblContentType.SelectedIte m.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.
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="Horizonta
ValidationGroup="SiteNameV
<asp:ListItem Value ="projects" Text="projects"></asp:List
<asp:ListItem Value="claims" Text="claims"></asp:ListIt
<asp:ListItem Value="sites" Text="sites"></asp:ListIte
</asp:RadioButtonList>
How would I pull the proper value for what is selected in my code? I have the following:
string siteoptionname = rblContentType.SelectedIte
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.
Looks ok. What happens when you run the program? Do you get unexpected values?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.