日期:2014-05-18 浏览次数:20643 次
function showdept() { Listdepnum()//这样调用行吗? }
DropDownList3.Attributes.Add("onClick", "showdept()") <Ajax.AjaxMethod(Ajax.HttpSessionStateRequirement.Read)> _ Private Sub Listdepnum() '顯示部門 If DropDownList2.SelectedIndex <> -1 Then Dim strSQL As String Dim dsResult As New DataSet Dim clsDBProcess As New dbprocess.OledbProcess strSQL = "select dept_num,dept_nam from DEPT where fac_num='" & DropDownList2.SelectedValue & "'" dsResult = clsDBProcess.GetDataSet(Session("Server"), Session("Database"), strSQL) DropDownList3.DataSource = dsResult DropDownList3.DataTextField = "dept_nam" DropDownList3.DataValueField = "dept_num" DropDownList3.DataBind() DropDownList3.Items.Insert(0, New ListItem("请选择", " ")) End If End Sub
以下是其它类同的调用例子 function Validata() { ClassesMaint.Listde(document.all.txtClsnum.value,Validata_Result_CallBack); } function Validata_Result_CallBack(response) { if (response.value != null) { var ds = response.value; if(ds != null && typeof(ds) == "object" && ds.tables != null) { for(var i=0; i<ds.tables[0].Rows.length; i++) { document.all.txtCrsnum.value=ds.tables[0].Rows[0].emp_chn_nam; return; } } } return }
<Ajax.AjaxMethod(Ajax.HttpSessionStateRequirement.Read)> _ 'Private Sub Listdep(ByVal DropDownList2) '顯示部門 '=======> public function Listdep(ByVal DropDownList2) '顯示部門 Dim strSQL As String Dim dsResult As New DataSet Dim clsDBProcess As New dbprocess.OledbProcess strSQL = "s