<AjaxPro.AjaxMethod(AjaxPro.HttpSessionStateRequirement.Read)> _
Public Function HandleSelect(ByVal table As String, ByVal eventSource As String, ByVal filterValue As String, ByVal targetControl As String) As StreetNameResponse
Dim tName As TableName
Dim filter As String = Nothing
Dim sort As String = Nothing
Dim textField As String = Nothing
Dim valueField As String = Nothing
Dim name As String = Nothing
Dim onChange As String = Nothing
'Assign security filter
CheckSecurityFilter()
Select Case table.ToLower
Case "county"
tName = TableName.County
If filterValue = "-1" Or filterValue = "" Then
If _restrictionLevel = RestrictionLevel.District Then
filter = _restrictionFilter
End If
Else
filter = String.Format("maintdisnmbr in ({}0)", filterValue)
End If
tName = TableName.County
sort = "countyname ASC"
textField = "countyname"
valueField = "countynmbr"
name = "selCounty"
onChange = "CheckSubmitEnabled();ajaxGetSelect('city','county', this, 'spanCity')"
Case "city"
If filterValue = "-1" Or filterValue = "" Then
'No value selected, set the filter to the default security value
If _restrictionLevel = RestrictionLevel.District Or _restrictionLevel = RestrictionLevel.County Then
filter = _restrictionFilter
End If
Else
Select Case eventSource.ToLower
Case "district"
filter = String.Format("maintdisnmbr in ({0})", filterValue)
Case "county"
filter = String.Format("countynmbr in ({0})", filterValue)
End Select
End If
tName = TableName.MasterCity
sort = "sams_cityname ASC"
textField = "sams_cityname"
valueField = "cityname_value"
name = "selCity"
onChange = "CheckSubmitEnabled()"
End Select
Dim selOutput As HtmlSelect = BuildSelect(tName, filter, sort, textField, valueField, name, onChange)
Dim outControl As New StreetNameResponse
outControl.targetControl = targetControl
outControl.outputControl = selOutput
MyBase.ProperCaseSelectControl(selOutput)
Return outControl
End Function
위 코드에서 디버깅 문제가 있습니다. 요점은 HTML에 있는데 세 개의 선택 태그가 있습니다. 지구, 군 및시. 교육구를 선택하면 해당 교육구의 카운티 또는 도시만을 제한하도록 카운티 및시를 갱신해야합니다. 시는 완벽하게 작동하지만 카운티는 그렇지 않습니다. 필자는 위의 코드를 통해 County Case 세그먼트를 실행하는 경우 filter = String.Format ("maintdisnmbr in ({} 0)", filterValue) 만 중지한다는 것을 발견했습니다. 단계별로 단계별로 진행하면 코드가 완료되지 않습니다. 단계별로 단계별로 나가지 않고 앞으로 뛰어 오르면 입력 문자열이 형식화되어 있지 않다는 오류가 발생합니다. 이것은 내 코드가 아니며 Ajax와 작업하지는 못했지만 문제를 해결하는 데 큰 도움이된다면 문제를 해결해야합니다.코드 끝까지 Ajax 호출이 중지됩니다.
이 보인다. 나쁜 코드 원숭이. 쿠키가 없습니다. –