Private Sub FilterGridView()
Dim strWhere As String = "it.AcctID=" & Profile.iFAacctID
'filter on horse owners
Select Case ddlOwners.SelectedItem.Text
Case "[All]"
Case "Horse Owners Only"
strWhere = strWhere & " AND it.HorseOwner=True"
Case "Non-Horse Owners Only"
strWhere = strWhere & " AND it.HorseOwner=False"
End Select
'filter on roles
If ddlRoles.SelectedItem.Text <> "[All]" Then
strWhere = strWhere & " AND it.PeopleRoles.RoleID=" & ddlRoles.SelectedValue
End If
'filter on first letter
If ddlStartsWith.SelectedItem.Text <> "[All]" Then
strWhere = strWhere & " AND it.fldClientName LIKE '" & ddlStartsWith.SelectedItem.Text & "%'"
End If
'filter on active status
Select Case ddlActives.SelectedItem.Text
Case "[All]"
Case "Actives Only"
strWhere = strWhere & " AND it.Inactive=False"
Case "Inactives Only"
strWhere = strWhere & " AND it.Inactive=True"
End Select
'apply filter and sorting to the EntityDataSource
edsContactList.Where = strWhere
If Len(edsContactList.OrderBy) > 0 Then
edsContactList.OrderBy = edsContactList.OrderBy
Else
edsContactList.OrderBy = "it.fldClientName"
End If
End Sub
ASKER
The successor to Active Server Pages, ASP.NET websites utilize the .NET framework to produce dynamic, data and content-driven web applications and services. ASP.NET code can be written using any .NET supported language. As of 2009, ASP.NET can also apply the Model-View-Controller (MVC) pattern to web applications
TRUSTED BY
to replace: ddlRoles.SelectedValue
To
ddlRoles.SelectedItem.Valu