Results 1 to 2 of 2

Thread: datalist

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Dec 2002
    Location
    London
    Posts
    678

    datalist

    Hi,
    The following code works fine in asp.net using vb.net but it gives the following error when the project is in c#. Do you know why?
    Thanks
    <SelectedItemTemplate>
    &nbsp;»
    <asp:HyperLink id=HyperLink2 runat="server" CssClass="DepartmentSelected" text='<%# DataBinder.Eval(Container.DataItem, "Name") %>' NavigateUrl='<%# "../default.aspx?DepartmentID=" &amp; DataBinder.Eval(Container.DataItem,"DepartmentID") &amp;"&amp;DepartmentIndex=" &amp; Container.ItemIndex %>'>
    </asp:HyperLink>
    </SelectedItemTemplate>


    Error: Operator '&' cannot be applied to operands of type 'string' and 'object'

  2. #2

    Thread Starter
    Fanatic Member
    Join Date
    Dec 2002
    Location
    London
    Posts
    678
    use + instead of &

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width