![]() |
|
|
|
#1 |
|
Can anyone help me with this code below I downloaded and this line does not work coz I'm using ASP.NET 2.0 I'm still new on asp.net. Is there anyone who know the Array.IndexOf(Of String) method
The Linq.Enumerable.Contains(Of String)(...) syntax will not compile if you are using ASP.NET version 2.0. The Contains(Of String) method is part of the LINQ library, which is new to ASP.NET 3.5. If you are still using ASP.NET version 2.0, use the Array.IndexOf(Of String) method instead Private Sub CheckRolesForSelectedUser() ' Determine what roles the selected user belongs to Dim selectedUserName As String = UserList.SelectedValue Dim selectedUsersRoles() As String = Roles.GetRolesForUser(selectedUserName) ' Loop through the Repeater's Items and check or uncheck the checkbox as needed For Each ri As RepeaterItem In UsersRoleList.Items ' Programmatically reference the CheckBox Dim RoleCheckBox As CheckBox = CType(ri.FindControl("RoleCheckBox"), CheckBox) ' See if RoleCheckBox.Text is in selectedUsersRoles If Linq.Enumerable.Contains(Of String)(selectedUsersRoles, RoleCheckBox.Text) Then RoleCheckBox.Checked = True Else RoleCheckBox.Checked = False End If Next End Sub msandlana |
|
|
|
|
![]() |
| Thread Tools | Search this Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Give you enough string functions in Java web reporting tool | freezea | Software | 0 | 10-08-2009 09:03 AM |
| Cancelling Timer and TimerTask threads | wfalby | Software | 1 | 04-30-2009 01:04 PM |
| Java String Problems | rbnbenjamin | General Help Related Topics | 0 | 02-03-2009 11:02 PM |
| Hidden linebreaks in string? VB.NET | Jiggy | Software | 0 | 04-23-2008 02:18 PM |