Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New to the CF scene
    Join Date
    Apr 2013
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    can't solve simple issue

    Hi all,

    I am new to this and need help please.

    Where it says

    adult = 100 * ddlAdults.SelectedItem.Value

    Instead of multiplying by 100, I want to multiple it by:-

    <%#Container.DataItem("adults")%>

    So when I try do this..

    adult = <%#Container.DataItem("adults")%> * ddlAdults.SelectedItem.Value

    It doesn't work? (BC31198: XML literal cannot appear here unless it is enclosed in parentheses.)

    Any help I'd be grateful, thanks!

    <asp:Repeater id="passengers" runat="server">
    <HeaderTemplate>
    <table>
    </HeaderTemplate>
    <ItemTemplate>
    <tr>
    <td><%#Container.DataItem("adults")%></td>
    <td><%#Container.DataItem("children")%></td>
    <td><%#Container.DataItem("infants")%></td>
    </tr>
    </ItemTemplate>
    <FooterTemplate>
    </table>
    </FooterTemplate>
    </asp:Repeater>

    <script runat="server" language="vb">
    Dim adult, children, infant, totalCost As Integer

    ' adults
    adult = 100 * ddlAdults.SelectedItem.Value

    ' children
    children = 50 * ddlChildren.SelectedItem.Value

    ' infants
    infant = 25 * ddlInfant.SelectedItem.Value

    ' calculate and display total
    totalCost = adult + children + infant
    lblCost.Text = "Total cost of your trip is: " & totalCost.ToString

    End Sub
    </script>

  • #2
    New to the CF scene
    Join Date
    Apr 2013
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Sorry it don't let me edit post to put in tags..


  •  

    Posting Permissions

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