Try: <%# NavTxt(CType(Container.DataItem, String)) %>
Ryan
On 9/1/05, Mike Appenzellar <[EMAIL PROTECTED]> wrote:
>
> 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 LINKS
>
>
> - Visit your group
> "AspNetAnyQuestionIsOk<http://groups.yahoo.com/group/AspNetAnyQuestionIsOk>"
> on the web.
> - To unsubscribe from this group, send an email to:
> [EMAIL PROTECTED]<[EMAIL PROTECTED]>
> - Your use of Yahoo! Groups is subject to the Yahoo! Terms of
> Service <http://docs.yahoo.com/info/terms/>.
>
>
> ------------------------------
>
--
Thank you,
Ryan Olshan
<asp:Web Programmer, Owner />
TeraNet Systems
http://www.teranetsystems.com
--------Internet E-Mail Confidentiality Statement--------
The content of and attachment(s) to this electronic transmission contains
information from TeraNet Systems and is intended for the use of the person,
firm or entity to which it is directed herein, and may contain information
that is private, confidential, exempt from disclosure under applicable law,
and/or proprietary to TeraNet Systems and is protected by law. If you are
not the intended recipient, or the employee or agent responsible for
delivering this message to the intended recipient, any dissemination,
distribution or copying of this communication is strictly prohibited. If you
have received this message in error, please notify the sender,
[EMAIL PROTECTED], immediately by reply e-mail and delete the original
message and any attachment(s) without reading or saving in any matter. Thank
you for your cooperation.
[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/