row3=dsTree.Tables(versionID).Rows(num3)
ClassID=dsTree.Tables(versionID).Rows(num3).Item(1)
item3.Text=row3.Item(0)
item3.NavigateUrl=”Classquery.aspx?ClassId=”+ClassID
item3.Target=”cmiddle”
item2.Nodes.Add(item3)
Next
item1.Nodes.Add(item2)
Next
item.Nodes.Add(item1)
Next
MyTreeView.Nodes.Add(item)
Next
End Sub
P rivate Sub Page_Load(ByVal sender As System.Object,ByVal e As System.EventArgs)Handles MyBase.Load
Tree()
’在此处放置初始化页的用户代码
End Sub
End Class
页面2(ClassQuery)
Imports System.Data
Imports System.Data.SqlClient
Public Class classQuery
Inherits System.Web.UI.Page
Protected WithEvents DataList1 As System.Web.UI.WebControls.DataList
Protected WithEvents DataList2 As System.Web.UI.WebControls.DataList
Protected WithEvents DataList3 As System.Web.UI.WebControls.DataList
#Region”Web窗体设计器生成的代码”
’该调用是Web窗体设计器所必需的。
Private Sub InitializeComponent()End Sub
Private Sub Page_(ByVal sender As System.Object,ByVal e As System.EventArgs)Handles MyBase.Init
’CODEGEN:此方法调用是Web窗体设计器所必需的
’不要使用代码编辑器修改它。
InitializeComponent()
End Sub
#End Region
Private Sub Page_Load(ByVal sender As System.Object,ByVal e As System.EventArgs)
Handles MyBase.Load
’在此处放置初始化页的用户代码
Dim MyConnection As SqlConnection
MyConnection=New SqlConnection(”server=(local);database=componentsystem;Trusted_Connection=yes”)
’If Not(Page.IsPostBack)Then
Dim clid As String
Dim DS1 As New DataSet()
Dim DS2 As New DataSet()
Dim DS3 As New DataSet()
clid=Request.QueryString(”classid”)
Dim MyCommand1 As New SqlDataAdapter(”select attributeid,attributename from tb_classattribute where classid=’”+clid+”’”,MyConnection)
MyCommand1.Fill(DS1,”attributename”)D ataList1.DataSource=DS1.Tables(”attributename”).DefaultViewDataList1.DataBind()D im MyCommand2 As New SqlDataAdapter(”select eventid, eventname from tb_classevent where classid=’”+clid+”’”,MyConnection)
MyCommand2.Fill(DS2,”eventname”)
DataList2.DataSource=DS2.Tables(”eventname”).DefaultView
DataList2.DataBind()
Dim MyCommand3 As New SqlDataAdapter(”select methodid, methodname from tb_classmethod where Classid=’”+clid+”’”,MyConnection)
MyCommand3.Fill(DS3,”methodname”)
DataList3.DataSource=DS3.Tables(”methodname”).DefaultView
DataList3.DataBind()
End Sub
Private Sub DataList1_SelectedIndexChanged(ByVal sender As System.Object,ByVal e AsSystem.EventArgs)Handles DataList1.SelectedIndexChanged
End Sub
Private Sub DataList2_SelectedIndexChanged(ByVal sender As System.Object,ByVal e AsSystem.EventArgs)
End Sub
Private Sub DataList3_SelectedIndexChanged(ByVal sender As System.Object,ByVal e AsSystem.EventArgs)Handles DataList3.SelectedIndexChanged
End Sub
End Class
页面3(属性详细)
事件,方法详细与之相仿
Imports System.Data
Imports System.Data.SqlClient
Public Class atrdetails
Inherits System.Web.UI.Page
Protected WithEvents Label3 As System.Web.UI.WebControls.Label
Protected WithEvents Label4 As System.Web.UI.WebControls.Label
Protected WithEvents TextBox2 As System.Web.UI.WebControls.TextBox
Protected WithEvents Label5 As System.Web.UI.WebControls.Label
Protected WithEvents Label2 As System.Web.UI.WebControls.Label
Protected WithEvents Label1 As System.Web.UI.WebControls.Label
Protected WithEvents TextBox1 As System.Web.UI.WebControls.Label
Protected WithEvents TextBox3 As System.Web.UI.WebControls.TextBox
#Region”Web窗体设计器生成的代码”
’该调用是Web窗体设计器所必需的。
Private Sub InitializeComponent()
End Sub
Private Sub Page_(ByVal sender As System.Object,ByVal e As System.EventArgs)
Handles MyBase.Init
’CODEGEN:此方法调用是Web窗体设计器所必需的
’不要使用代码编辑器修改它。
InitializeComponent()
End Sub
#End Region
Private Sub Page_Load(ByVal sender As System.Object,ByVal e As System.EventArgs)
Handles MyBase.Load
Dim MyConnection As SqlConnection
MyConnection=New SqlConnection (”server=(local);database=componentsystem;
Trusted_Connection=yes”)
Dim atrid As String
atrid=Request.QueryString(”attributeid”)
Dim DS As New DataSet()
Dim MyCommand As New SqlDataAdapter(”select AttributeID,AttributeType,AttributeInstruction,AttributeExample from tb_classattribute where attributeid=’”+atrid+”’”,MyConnection)
MyCommand.Fill(DS,”AttributeDetails”)
Label1.Text=DS.Tables(”AttributeDetails”).Rows(0).Item(0)
TextBox1.Text=DS.Tables(”AttributeDetails”).Rows(0).Item(1)
TextBox2.Text=DS.Tables(”AttributeDetails”).Rows(0).Item(2)
TextBox3.Text=DS.Tables(”AttributeDetails”).Rows(0).Item(3)
End Sub
End Class
11.管理员登入页面
说明:以下代码为管理员登入检验页面vb代码.
Imports System.Data
Imports System.Data.SqlClient
Public Class leftuser
Inherits System.Web.UI.Page
Protected WithEvents Image1 As System.Web.UI.WebControls.Image
Protected WithEvents hlkadminlogin As System.Web.UI.WebControls.HyperLink
Protected WithEvents lbladminid As System.Web.UI.WebControls.Label
Protected WithEvents txtadminid As System.Web.UI.WebControls.TextBox
Protected WithEvents lbladminpwd As System.Web.UI.WebControls.Label
Protected WithEvents txtadminpwd As System.Web.UI.WebControls.TextBox
Protected WithEvents ibtnsubmit As System.Web.UI.WebControls.ImageButton
Protected WithEvents ibtncancel As System.Web.UI.WebControls.ImageButton
Protected WithEvents lblstatues As System.Web.UI.WebControls.Label
Protected WithEvents myDataGrid As System.Web.UI.WebControls.DataGrid
#Region”Web窗体设计器生成的代码”
’该调用是Web窗体设计器所必需的。
Private Sub InitializeComponent()End Sub