main.aspx.vb
Protected
Sub Page_Load()
Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
![InBlock.gif](/Images/OutliningIndicators/InBlock.gif)
Dim cs As ClientScriptManager = Page.ClientScript
Dim cstype As Type = Me.GetType()
If (Not cs.IsClientScriptBlockRegistered("clientScriptDance")) Then '选择人
Dim strScript As String = "<script>" + vbCrLf
strScript += "function OpenWin(){" + vbCrLf
strScript += "var str=window.showModalDialog('Frmstaff.aspx',document.getElementById('StaffID').value,'dialogWidth=683px;dialogHeight=510px')" + vbCrLf
strScript += "if(str!=null) document.getElementById('StaffID').value=str" + vbCrLf
strScript += "}" + vbCrLf
strScript += "</script>" + vbCrLf
cs.RegisterClientScriptBlock(cstype, "clientScriptDance", strScript)
End If
![InBlock.gif](/Images/OutliningIndicators/InBlock.gif)
If Not IsPostBack Then
buttStaff.Attributes.Add("onclick", "OpenWin()")
End If
SetStaffArrID()
End Sub
![None.gif](/Images/OutliningIndicators/None.gif)
![ExpandedBlockStart.gif](/Images/OutliningIndicators/ExpandedBlockStart.gif)
Private
Sub SetStaffArrID()
Sub SetStaffArrID()
Dim brr As Array
If InStr(Me.StaffID.Value, FIELD_SPLITOR) > 0 Then '返回人的信息
brr = Split(Me.StaffID.Value, FIELD_SPLITOR)
Me.SID.Value = brr(0)
Me.StaffCode.Value = brr(1)
Me.StaffName.Value = brr(2)
Me.TxtOrgID.Value = brr(3)
Me.TxtOrgName.Value = brr(4)
Me.TxtDropID.value = brr(5)
Me.TxtDropName.Value = brr(6)
Me.TxtName.Text = brr(2)
![InBlock.gif](/Images/OutliningIndicators/InBlock.gif)
End If
![InBlock.gif](/Images/OutliningIndicators/InBlock.gif)
End Sub
hypo.aspx.vb
Protected
Sub buttOK_Click()
Sub buttOK_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles buttOK.Click
Dim StrID As String = ""
Dim StrName As String = ""
Dim StrCode As String = ""
![InBlock.gif](/Images/OutliningIndicators/InBlock.gif)
If StrID <> "" Then
StaffID.Value = StrID & FIELD_SPLITOR & StrCode & FIELD_SPLITOR & StrName & FIELD_SPLITOR & HTreeOrg.Value & FIELD_SPLITOR & HTreeOrgName.Value & FIELD_SPLITOR & hDropID.Value & FIELD_SPLITOR & hDropname.Value
Else
StaffID.Value = ""
End If
![InBlock.gif](/Images/OutliningIndicators/InBlock.gif)
Dim Cs As ClientScriptManager = Page.ClientScript
Dim cstype As Type = Me.GetType()
![InBlock.gif](/Images/OutliningIndicators/InBlock.gif)
Dim strScript As String = "<script>" + vbCrLf
strScript += "window.parent.returnValue='" + StaffID.Value.Replace("'", "\'") + "'" + vbCrLf
strScript += "window.parent.close()" + vbCrLf
strScript += "</script>" + vbCrLf
If (Not Cs.IsClientScriptBlockRegistered("clientScriptDance")) Then
Cs.RegisterClientScriptBlock(cstype, "clientScriptDance", strScript)
End If
![InBlock.gif](/Images/OutliningIndicators/InBlock.gif)
End Sub
转载于:https://www.cnblogs.com/jiemupig/archive/2006/09/11/500744.html