Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Tom Newton 3 posts 23 karma points
    Mar 06, 2013 @ 11:56
    Tom Newton
    0

    Help needed with search string. Will pay for help.

    Have a look at http://www.cumbria-pcc.gov.uk/governance-transparency/document-library.aspx

    There's a simple loop script to show all the child files within the folder:

    @{ var numberOfItems = 100; }

        @foreach (var item in @Model.Children.Where("Visible").Take(numberOfItems)  )
        {

     

    I need to add 'where' to the query. The user can select from category, year or free text search. I have managed to get the querystring values on the page, but I don't know how to write the code.

    If I was writing a SQL statement, it would be something like:

    where category = '" & var1 & "' and documentdate = '" & var2 & "' and Description like '%" & var3 & "%' "

     

     

     

  • Charles Afford 1163 posts 1709 karma points
    Mar 10, 2013 @ 11:45
    Charles Afford
    0

    Hi, first of all you dont need to define that var numberOfItem you can just pass 100 straight into Take().  So .Take(100);

    Could you tell me exaclty the data you need to get from you list or IEnum (I am assuming its an IEnum?).

    Are you using your own custom model or getting the data straight from Umbraco (Umbraco.TemplatePage)?

    Let me know and i will try and help some more :).

    Thanks.

    Charlie :)

Please Sign in or register to post replies

Write your reply to:

Draft