一聚教程网:一个值得你收藏的教程网站

热门教程

召集Button Event

时间:2022-06-30 09:49:07 编辑:袖梨 来源:一聚教程网

这里例子将说明如何利用Code-Behind forms召集Button Event
<%@ Page Inherits="MyCodeBehind" Src="cp.vb" Debug="True" Language="VB" %>


New Page 1









cp.vb的代码如下
我将他封装成类
Option Strict Off
Imports System
Imports System.DateTime
Imports System.Globalization
Imports System.Data
Imports System.Data.SQL
Imports System.Web.UI
Imports System.Web.UI.WebControls
Imports System.Web.UI.HtmlControls
Public Class MyCodeBehind : Inherits Page
     
    Public Sub B1_Click(Sender As Object, E As EventArgs)
    response.write("B1 was click")
    End Sub
     
    Public Sub B2_Click(Sender As Object, E As EventArgs)
     response.write("B2 was click")
    End Sub
    Public Sub B3_Click(Sender As Object, E As EventArgs)
        response.write("B3 was click")
    End Sub
End Class

热门栏目