Copied to clipboard

Flag this post as spam?

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


  • Prachi Vyas 10 posts 110 karma points
    May 15, 2019 @ 09:21
    Prachi Vyas
    0

    Filter Data send from one page to another

    Hello Everyone,

    I have attached page here and want to do filter by click on "Find Car". On the click my page redirects to the next page of vehicles with those given filter result. But I am confused how would I redirect my page with these data in umbraco. Please help me out its urgent.

    enter image description here

  • Ronak Panchal 71 posts 230 karma points
    May 15, 2019 @ 09:45
    Ronak Panchal
    100

    Hello Prachi,

    You can pass URL parameter values to your tracking destination URL and from there you can easily get the value of those parameters in your template or even in partial view or macro.

    Hope this will help,

    Ronak Panchal.

  • Prachi Vyas 10 posts 110 karma points
    May 15, 2019 @ 10:40
    Prachi Vyas
    0

    Thanks @Ronak panchal I have get those values on another page. Now I wan to comapre it with my query. But I was not able to pass it in this given below query. Please help me out.

    @{
            var Id = Request.RawUrl; //Gets value from url
            var tempID = Id.Split('?').Last(); //splits unnecessary characters
            string[] data = tempID.Split('&');
    
            string maker = data[0].Split('=').Last();
            string body = data[1].Split('=').Last();
            string keyword = data[2].Split('=').Last();
    
    
    
    
    
            var selection = Umbraco.Content(Guid.Parse("3758071d-10c8-4890-b680-64f43a7b4149"))
            .Children("vehicles")
            .Where(x => x.IsVisible())
            .OrderByDescending(x => x.Id);
    
    
            //var workcollection = selection.Where("");
    
    
        }
    
  • Ronak Panchal 71 posts 230 karma points
    May 15, 2019 @ 11:21
    Ronak Panchal
    0

    Hello Prachi,

    Just debug that code and check what you got in a variable selection,

    Probably you can search for the properties in for each item and make LINQ query to filter the list as you did for getting items in the selection.

    The second way, you can make a new class and make a new method for filter those data according to parameters and return list( filtered ) and just traversing that returned filtered in view to display filtered result.

    Ronak.

Please Sign in or register to post replies

Write your reply to:

Draft