我写了一个函数是这样的
[code]
Protected Function checknull(ByVal list As String(), ByVal sw As Boolean) As Boolean
            If list.Length <> 0 Then
                Dim obj As New Object
                Dim i As Integer
                Dim flag As Boolean = False
                If sw = True Then
                    For i = 0 To list.Length - 1
                        obj = FindControl(list(i))
                        If TypeOf obj Is TextBox Then
                            If CType(obj, TextBox).Text = "" Then
                                Return False
                            End If
                        ElseIf TypeOf obj Is DropDownList Then
                            If CType(obj, DropDownList).SelectedValue = CStr(0) Then
                                Return False
                            End If
                        End If
                    Next
                    Return True
                Else
                    For Each obj In Controls(1).Controls
                        For i = 0 To list.Length - 1
 ---问题出在这里---------   If obj = list(i) Then ----------------------------
                                flag = True
                            End If
                        Next
                        If flag = False Then
                            If TypeOf obj Is TextBox Then
                                If CType(obj, TextBox).Text = "" Then
                                    Return False
                                End If
                            ElseIf TypeOf obj Is DropDownList Then
                                If CType(obj, DropDownList).SelectedValue = CStr(0) Then
                                    Return False
                                End If
                            End If
                        End If
                    Next
                    Return True
                End If
            End If
        End Function[/code]看我上面画线的地方,提示说在option strict on 的时候不允许后期绑定。obj是一个object,而且不知道他在页面上显示的时候是什么类型,所以没法用ctype进行类型转换呀。大家帮忙想想办法。给个解决方案。