[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

Set selectedvalue on radiobuttonlist

Posted on 2009-05-20
3
Medium Priority
?
423 Views
Last Modified: 2012-08-14
I have a radiobuttonlist in a form with three values and at some times I want to be able to update the form and then I want the selected radiobutton from before to be selected.

I've tried this and it works except that the actual radiobutton is'nt checked at update state.


<asp:RadioButtonList ID="rbAllowOptions" RepeatDirection="Horizontal" runat="server">
                <asp:ListItem Value="Credit Card" Text="Credit card" />
                <asp:ListItem Value="Invoice" Text="Invoice" />
                <asp:ListItem Value="Both" Text="Both" />
            </asp:RadioButtonList>
 
---------------------------------------------------------
Dim ccArray As New ArrayList
                                    ccArray = GetCreditCardDef(iIdentity) 'checks if Credit Card is selected
 
                                    If (ccArray(7) = "True") Then"
                                        rbAllowOptions.Items.FindByValue("Credit Card").Selected = True
                                    End If

Open in new window

0
Comment
Question by:mattegol
[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
  • 2
3 Comments
 
LVL 4

Expert Comment

by:rdoran0928
ID: 24431556
you won't see the radio button checked until your page does a postback
0
 
LVL 4

Accepted Solution

by:
rdoran0928 earned 1000 total points
ID: 24433075
There's a simpler way to set:

rbAllowOptions.SelectedValue = "Credit Card"

Also, you may have a problem in that value in text are different in case

<asp:ListItem Value="Credit Card" Text="Credit card" />

Value is upper case Card, text is lower case card
0
 

Author Comment

by:mattegol
ID: 24435016
Thanks for your comments I'm gonna test it tomorrow.
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

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

Just a quick little trick I learned recently.  Now that I'm using jQuery with abandon in my asp.net applications, I have grown tired of the following syntax:      (CODE) I suppose it just offends my sense of decency to put inline VBScript on a…
This article discusses the ASP.NET AJAX ModalPopupExtender control. In this article we will show how to use the ModalPopupExtender control, how to display/show/call the ASP.NET AJAX ModalPopupExtender control from javascript, how to show/display/cal…
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…
Is your data getting by on basic protection measures? In today’s climate of debilitating malware and ransomware—like WannaCry—that may not be enough. You need to establish more than basics, like a recovery plan that protects both data and endpoints.…
Suggested Courses

650 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