Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Assigning a default value on RadioButtonList

Status
Not open for further replies.

Andel

Programmer
Feb 15, 2001
366
US
I'm trying to assign a default value to my radiobuttonlist but for some reason the following code gives "Build Failed" when I publish my web.

Code:
    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        If IsPostBack = False Then
            radStatus.SelectedValue = 1
        End If
    End Sub

What's wrong with this code? Please help.


 
You'll have to be more specific. What is the exact error and on what line does the error occur?
 
Isn't SelectedValue supposed to be a string?


radStatus.SelectedValue = "1"
 
I don't actually know what happen but what I did is to delete the whole page and recreate it. I used the same code and it works. thanks anyway.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top