That gives me "*Cast from type 'DataRowView' to type 'String' is not valid.*"
On 9/1/05, Ryan Olshan <[EMAIL PROTECTED]> wrote:
>
> 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]
>
>
>
> SPONSORED LINKS
> Basic programming
> language<http://groups.yahoo.com/gads?t=ms&k=Basic+programming+language&w1=Basic+programming+language&w2=Computer+programming+languages&w3=Programming+languages&w4=Java+programming+language&w5=The+history+of+computer+programming+language&c=5&s=176&.sig=clJRDppRYABhs6xUhzokKw>
> Computer
> programming
> languages<http://groups.yahoo.com/gads?t=ms&k=Computer+programming+languages&w1=Basic+programming+language&w2=Computer+programming+languages&w3=Programming+languages&w4=Java+programming+language&w5=The+history+of+computer+programming+language&c=5&s=176&.sig=RiWZhYTiihJ1rWfeFgB2sg>
> Programming
> languages<http://groups.yahoo.com/gads?t=ms&k=Programming+languages&w1=Basic+programming+language&w2=Computer+programming+languages&w3=Programming+languages&w4=Java+programming+language&w5=The+history+of+computer+programming+language&c=5&s=176&.sig=2BgLsjKfGvxPndstKBMU9g>
> Java
> programming
> language<http://groups.yahoo.com/gads?t=ms&k=Java+programming+language&w1=Basic+programming+language&w2=Computer+programming+languages&w3=Programming+languages&w4=Java+programming+language&w5=The+history+of+computer+programming+language&c=5&s=176&.sig=4wWSX5WKx7BCK9SrMVdrxQ>
> The
> history of computer programming
> language<http://groups.yahoo.com/gads?t=ms&k=The+history+of+computer+programming+language&w1=Basic+programming+language&w2=Computer+programming+languages&w3=Programming+languages&w4=Java+programming+language&w5=The+history+of+computer+programming+language&c=5&s=176&.sig=iNvYp6cfd9HwtDhK1iV-rg>
>
> ------------------------------
> 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/>.
>
>
> ------------------------------
>
[Non-text portions of this message have been removed]
------------------------ Yahoo! Groups Sponsor --------------------~-->
Get Bzzzy! (real tools to help you find a job). Welcome to the Sweet Life.
http://us.click.yahoo.com/A77XvD/vlQLAA/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/