hola compañeros estoi haciendo un sistema de encuestas,me da un error, mas concretamente:
El control 'repeater1__ctl1_0' de tipo 'RadioButton' debe colocarse dentro de una etiqueta de formulario con runat=server.
y nose como solucionarlo,he metido el codigo para ver si alguien me puede ayudar
gracias por anticipado.
Public Class WebForm1
Inherits System.Web.UI.Page
Protected WithEvents Radio As System.Web.UI.WebControls.RadioButtonList
Protected WithEvents button1 As System.Web.UI.WebControls.Button
Protected WithEvents dg As System.Web.UI.WebControls.DataGrid
Protected WithEvents repeater1 As System.Web.UI.WebControls.Repeater
Protected WithEvents preg_1 As System.Web.UI.WebControls.Label
......codigo que genera la herramienta
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim cn As New OleDb.OleDbConnection()
Dim da As New OleDb.OleDbDataAdapter()
Dim ds As New DataSet()
Dim str As String
str = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source = C:\Inetpub\wwwroot\Encuestas\encuestas.mdb"
cn.ConnectionString = str
cn.Open()
If Not Page.IsPostBack Then
da = New OleDb.OleDbDataAdapter("select pre_descrip,pre_id,pre_tipo from preguntas where enc_id = 1", cn)
ds = New DataSet()
da.Fill(ds, "preguntas")
repeater1.DataSource = ds.Tables("preguntas")
repeater1.DataBind()
End If
End Sub
Private Sub repeater1_ItemDataBound(ByVal sender As Object, ByVal e As RepeaterItemEventArgs) Handles repeater1.ItemDataBound
If Not DataBinder.Eval(e.Item.DataItem, "pre_id") Is Nothing Then
Dim fila As TableRow = New TableRow()
Dim celda As TableCell = New TableCell()
celda.Text = DataBinder.Eval(e.Item.DataItem, "pre_descrip")
fila.Cells.Add(celda)
repeater1.Controls.Add(fila)
fila = New TableRow()
celda = New TableCell()
Dim radio As RadioButtonList = New RadioButtonList()
If DataBinder.Eval(e.Item.DataItem, "pre_tipo") = 1 Then
radio.Items.Add("Muy alto")
radio.Items.Add("Alto")
radio.Items.Add("Medio")
radio.Items.Add("Bajo")
radio.Items.Add("Muy bajo")
ElseIf DataBinder.Eval(e.Item.DataItem, "pre_tipo") = 2 Then
radio.Items.Add("si")
radio.Items.Add("no")
End If
celda.Controls.Add(radio)
fila.Cells.Add(celda)
repeater1.Controls.Add(fila)
End If
End Sub
'Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles button1.Click
'Dim res As String
'If RadioButtonList1.SelectedIndex > -1 Then
'res = RadioButtonList1.SelectedItem.Text
'End If
' End Sub
End Class