0% found this document useful (0 votes)
26 views

Partial Class Inherits Protected Sub Byval As Object Byval As Handles Select Case Case Case Case End Select End Sub

The document contains code for several partial classes that handle user interface events in ASP.NET web forms. The classes handle events like button clicks, dropdown list selection changes, and validate user input. They update labels, lists, and display messages depending on the user's selections and input.
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
26 views

Partial Class Inherits Protected Sub Byval As Object Byval As Handles Select Case Case Case Case End Select End Sub

The document contains code for several partial classes that handle user interface events in ASP.NET web forms. The classes handle events like button clicks, dropdown list selection changes, and validate user input. They update labels, lists, and display messages depending on the user's selections and input.
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

Partial Class _Default

Inherits System.Web.UI.Page
Protected Sub BulletedList1_Click(ByVal sender As Object, ByVal e As
System.Web.UI.WebControls.BulletedListEventArgs) Handles BulletedList1.Click
Select Case (e.Index)
Case 0
Label1.Text = "Quieres entrar a Senati xD"
Case 1
Label1.Text = "Quieres entrar a Google"
Case 2
Label1.Text = "Quieres entrar a Terra"
End Select
End Sub

Partial Class Default2


Inherits System.Web.UI.Page
Protected Sub DropDownList1_SelectedIndexChanged(ByVal sender As Object, ByVal e As
System.EventArgs) Handles DropDownList1.SelectedIndexChanged
MultiView1.ActiveViewIndex = DropDownList1.SelectedIndex
End Sub
End Class
Partial Class Default3
Inherits System.Web.UI.Page

Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles


Button1.Click
If Not IsNumeric(TextBox1.Text) Then
MsgBox("El dato debe ser un numero")
Else
MsgBox("Correcto")
End If
End Sub
End Class

Partial Class Default4


Inherits System.Web.UI.Page

Protected Sub Button1_Click(ByVal sender As Object, ByVal e As


System.EventArgs) Handles Button1.Click
If TextBox1.Text.Trim = "" Then
MsgBox("ingrese un dato")
TextBox1.Focus()
Else
ListBox1.Items.Add(TextBox1.Text)
TextBox1.Text = Nothing
TextBox1.Focus()
End If
End Sub
End Class
Partial Class Default7
Inherits System.Web.UI.Page
Protected Sub DropDownList1_SelectedIndexChanged(ByVal sender As Object, ByVal e As
System.EventArgs) Handles DropDownList1.SelectedIndexChanged
MultiView1.ActiveViewIndex = DropDownList1.SelectedIndex
End Sub
Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles
Button1.Click
If ListBox1.SelectedIndex <> -1 Then
ListBox2.Items.Add(ListBox1.SelectedItem)
ListBox1.Items.RemoveAt(ListBox1.SelectedIndex)
ListBox1.SelectedIndex = -1
ListBox2.SelectedIndex = -1
End If
End Sub
Protected Sub Button2_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles
Button2.Click
If RadioButton1.Checked Then
If RadioButton2.Checked Then
Else
MsgBox("Debe elegir un sexo")
End If
Else
MsgBox("Debe elegir un sexo")
End If
End Sub
End Class

You might also like