Ver Mensaje Individual
  #1 (permalink)  
Antiguo 30/08/2004, 18:25
Avatar de Fher
Fher
 
Fecha de Ingreso: febrero-2003
Ubicación: En algun lugar de cancun
Mensajes: 384
Antigüedad: 22 años
Puntos: 0
borrar un radiobuttonlist

hola estoy haciendo lo tipico de limpiar los controles al guardar en una base de datos ya consegui hacerlo con los textboxs, los dropdownlist, pero no consigo hacerlo con radiobuttonlist

este es el codigo

Dim miForma As Control = Page.FindControl("form1")
Dim ctl As Control
For Each ctl In miForma.Controls
If ctl.GetType().ToString().Equals("System.Web.UI.Web Controls.TextBox") Then
CType(ctl, TextBox).Text = ""
End If
If ctl.GetType().ToString().Equals("System.Web.UI.Web Controls.DropDownList") Then
CType(ctl, Dropdownlist).selectedindex = -1
CType(ctl, DropDownList).SelectedItem.Value = ""
CType(ctl, DropDownList).SelectedItem.Text = ""
End If

'************** este es el problema ya que no se borra e investigado las propiedades para borrar un radiobutton list y las tengo todas habilitadas y aun asi no me funcionan, alguien sabe la forma correcta o que estoy haciendo mal
'**************
If ctl.GetType().ToString().Equals("System.Web.UI.Web Controls.RadioButtonList") Then
CType(ctl, RadioButtonList).selectedindex = -1
CType(ctl, RadioButtonList).ClearSelection()
CType(ctl, RadioButtonList).SelectedItem.Value = ""
CType(ctl, RadioButtonList).SelectedItem.Text = ""
End If
Next ctl

gracias..
__________________
solo firma