Ver Mensaje Individual
  #3 (permalink)  
Antiguo 04/02/2006, 18:07
Bluewake
 
Fecha de Ingreso: febrero-2006
Mensajes: 2
Antigüedad: 18 años, 11 meses
Puntos: 0
200.25.188.241/SAED/WebForm2.aspx

Public Class WebForm2
Inherits System.Web.UI.Page
Protected WithEvents RadioButtonList1 As System.Web.UI.WebControls.RadioButtonList
Protected WithEvents Label1 As System.Web.UI.WebControls.Label
Protected WithEvents Button1 As System.Web.UI.WebControls.Button
Protected WithEvents RadioButtonList2 As System.Web.UI.WebControls.RadioButtonList
Protected WithEvents Button2 As System.Web.UI.WebControls.Button
Protected WithEvents Label2 As System.Web.UI.WebControls.Label
Protected WithEvents Label3 As System.Web.UI.WebControls.Label
Protected WithEvents Label4 As System.Web.UI.WebControls.Label
Dim learnEst As New PryLearn.ClsEstudiante()

Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs)
Handles MyBase.Load

'Introducir aquí el código de usuario para inicializar la página
If Page.IsPostBack = False Then
'Enlace a datos del rbl1
Dim ds As New System.Data.DataSet()
ds = learnEst.respuestas(1)
Me.RadioButtonList1.DataSource = ds
Me.RadioButtonList1.DataBind()
End If
End Sub

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
Handles Button1.Click

'Prueba identificacion de elemento seleccionado
Me.Label1.Text = Me.RadioButtonList1.SelectedItem.Text
End Sub

Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
Handles Button2.Click

'Prueba identificacion de elemento seleccionado
Me.Label2.Text = Me.RadioButtonList2.SelectedItem.Text
End Sub

Private Sub RadioButtonList2_SelectedIndexChanged(ByVal sender As System.Object, ByVal
e As System.EventArgs) Handles RadioButtonList2.SelectedIndexChanged

'Prueba identificacion de elemento seleccionado
Me.Label2.Text = Me.RadioButtonList2.SelectedItem.Value
End Sub

Private Sub RadioButtonList1_SelectedIndexChanged(ByVal sender As System.Object, ByVal
e As System.EventArgs) Handles RadioButtonList1.SelectedIndexChanged

'Prueba identificacion de elemento seleccionado
Me.Label1.Text = Me.RadioButtonList1.SelectedItem.Value
End Sub

End Class

------------------------------------------------------------------------------------------

<body MS_POSITIONING="GridLayout">
<form id="Form1" method="post" runat="server">
<asp:RadioButtonList id="RadioButtonList1" style="Z-INDEX: 101; LEFT: 320px; POSITION: absolute; TOP: 224px" runat="server" DataValueField="valresp" DataTextField="resp" AutoPostBack="True"></asp:RadioButtonList>
<asp:Label id="Label1" style="Z-INDEX: 102; LEFT: 344px; POSITION: absolute; TOP: 136px" runat="server">Label</asp:Label>
<asp:Button id="Button1" style="Z-INDEX: 103; LEFT: 336px; POSITION: absolute; TOP: 168px" runat="server" Text="Button"></asp:Button>
<asp:RadioButtonList id="RadioButtonList2" style="Z-INDEX: 104; LEFT: 80px; POSITION: absolute; TOP: 224px" runat="server" AutoPostBack="True">
<asp:ListItem Value="valoruva">uva</asp:ListItem>
<asp:ListItem Value="valormanzana">manzana</asp:ListItem>
<asp:ListItem Value="valorpera">pera</asp:ListItem>
<asp:ListItem Value="valorciruela">ciruela</asp:ListItem>
</asp:RadioButtonList>
<asp:Button id="Button2" style="Z-INDEX: 105; LEFT: 104px; POSITION: absolute; TOP: 176px" runat="server" Text="Button"></asp:Button>
<asp:Label id="Label2" style="Z-INDEX: 106; LEFT: 112px; POSITION: absolute; TOP: 136px" runat="server">Label</asp:Label>
<asp:Label id="Label3" style="Z-INDEX: 107; LEFT: 88px; POSITION: absolute; TOP: 96px" runat="server">ESTATICO</asp:Label>
<asp:Label id="Label4" style="Z-INDEX: 108; LEFT: 296px; POSITION: absolute; TOP: 96px" runat="server">DINAMICO (enlazado a datos)</asp:Label>
</form>
</body>

muchas gracias zaqpz por tu código, lo estoy revisando
saludos, Bluewake

Última edición por Bluewake; 04/02/2006 a las 18:16