Ver Mensaje Individual
  #7 (permalink)  
Antiguo 13/01/2009, 13:20
samccp
 
Fecha de Ingreso: enero-2009
Mensajes: 7
Antigüedad: 15 años, 4 meses
Puntos: 0
Respuesta: FOCO en TextBox

hola, acabo de realizar una prueba tanto en un sitio asp.net ajax enables y un sitio asp.net normalito, en ambos casos la rutina fue igual, te paso el codigo html asi como el de vb.net para que veas el procedimiento, cualquier duda me avisas...

Codigo Html:
<div>
<asp:DropDownList ID="DropDownList1" runat="server" AutoPostBack ="true">
<asp:ListItem Text="Opcion 1" Value="0"></asp:ListItem>
<asp:ListItem Text="Opcion 2" Value="1"></asp:ListItem>
<asp:ListItem Text="Opcion 3" Value="2"></asp:ListItem>
</asp:DropDownList>
<hr />
<asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
<asp:TextBox ID="TextBox2" runat="server"></asp:TextBox>
</div>

Codigo vb.Net
Protected Sub DropDownList1_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles DropDownList1.SelectedIndexChanged
If DropDownList1.SelectedValue = "1" Then
Me.TextBox1.Focus()
Else
Me.TextBox2.Focus()
End If
End Sub