Hi
I use asp.net 2 and have one asp:sqldatasource and one asp:radiobuttonlist on my aspx page, the radiobuttonlist is filled with data from my sql server. I further have a imagebutton that the user should click when he have made a choise from the radiobuttonlist. But the problem is that its not always the radiobutton list gets values from the database. This depends on what ID querystring is being passed. And when there are no radiobutton items to choose from I would like to disable the imagebutton. How can I do that in my codebehind? I tryed to use this...
But that always disable the imagebutton.
Regards
I use asp.net 2 and have one asp:sqldatasource and one asp:radiobuttonlist on my aspx page, the radiobuttonlist is filled with data from my sql server. I further have a imagebutton that the user should click when he have made a choise from the radiobuttonlist. But the problem is that its not always the radiobutton list gets values from the database. This depends on what ID querystring is being passed. And when there are no radiobutton items to choose from I would like to disable the imagebutton. How can I do that in my codebehind? I tryed to use this...
Code:
If RadioButtonList2.Items.Count > 0 Then
ImageButton1.Enabled = True
Else
ImageButton1.Enabled = False
End If
But that always disable the imagebutton.
Regards