I have the following code:
 <asp:Repeater id="nav1" runat="server">
<ItemTemplate>
<%# NavTxt(Container.DataItem) %>
</ItemTemplate>
</asp:Repeater>
 The code above spits out a checkbox using:
 
Public Function NavTxt(ByVal DataItem As Object) As String
....
TempTxt = "<input type='checkbox' name='permsbox' value='" & DataItem("id") 
& "'>" & DataItem("navTitle") & "<br>"

Now my problem is that I need to do something like:

Dim location As String
location = Values.BinarySearch(DataItem("id")) 'Find item in my array called 
Values

if location > 0 Then
TempTxt = "<input type='checkbox' name='permsbox' value='" & DataItem("id") 
& "'>" & DataItem("navTitle") & "<br>"
else
TempTxt = "<input type='checkbox' name='permsbox' value='" & DataItem("id") 
& "' checked>" & DataItem("navTitle") & "<br>"
End if 

But no matter what I get the following error:

[ArgumentException: Object must be of type String.]
System.String.CompareTo(Object value) +157
System.Collections.Comparer.Compare(Object a, Object b) +150
System.Array.BinarySearch(Array array, Int32 index, Int32 length, Object 
value, IComparer comparer) +261

Any ideas?

 but NO MATTER WHAT I get


[Non-text portions of this message have been removed]



------------------------ Yahoo! Groups Sponsor --------------------~--> 
Most low income households are not online. Help bridge the digital divide today!
http://us.click.yahoo.com/cd_AJB/QnQLAA/TtwFAA/saFolB/TM
--------------------------------------------------------------------~-> 

 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/AspNetAnyQuestionIsOk/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 


Reply via email to