Asp.Net MVC Paged List and passing Search Criteria - asp.net-mvc-4

I am using Troy Goode's PagedList extension on my MVC page. It is working fine by rendering the partial containing given page of records.
Now I have to implement filtering of search results. I am using AJAX form to fetch partial containing results matching with given search criteria. This works well if there are less than one page of results. If the filtered results beyond one page, there is an issue. When clicked on paging link the filtering information is gone and it results next page of unfiltered information.
What mechanism I can use to pass filtering information when something is entered to filter search results and there is paging link?

My PagedList library takes a Func to generate the URL when you call #Html.PagedList(...):
page => Url.Action("Index", new { page = page })
You simply need to customize the parameters you're passing into Url.Action (which is a Microsoft class/method, docs can be found on MSDN).

Related

Fetch items from Directus Api

I've one site with multilingual options and foreach language I've some different contents that are inside on Directus page Translations fields.
I already have one fetch that return all the fields that are included inside this certain Directus page:
https://xxx/items/xxx_page?fields=*,translations.*,page_contents.translations.*,related_pages.translations.*,related_pages.*,page_contents.*&filter[languages_code]=it-IT&filter[page_contents.translations][languages_code]=it-IT
It return all the contents and all the translations fields, but I would optimize the page load.
How can I change the fetch of the fields whith a filter for take only the fields that have a certain languages_code value.
I've already tried to use filter:
?fields=*,page_contents.*,page_contents.translations.*&?filter[page_contents][translations][languages_code][_eq]=it-IT
but without results.
Can someone help me?
Thanks.

Passing search and filter parameters between Components

I am trying to implement breadcrum functionality in my application using Blazor.
My requirements are:
Search page - Click search: shows list of items using card
I have a filter box to filter data . e.g posted date, range
When I select a single item, it should go the detail page. On the detail page I should see a breadcrum like - Home -> View -> Detail
So when I click on the View breadcrum item it should take me back to view page with the previous search parameters and filters selected
I know how to pass single parameters between components but little confuse how can I pass multiple parameters to parent and again back to child component. Please advise. Thank you

Yii CListView pagination linking to previous result

I have a CListView with pagination showing all results. Everything works fine.
I have a search widget on the page that renders a partial view to replace the existing list with search results.
The first search result page loads, looks great, and even shows the correct number of results in pagination, but if I try to go to one of the next pages, items from the first list are loaded.
Does anyone know what I have to do in order to fix this? Do the search results need their own full view rendered?
Thanks you in advance.
I was mistaken.
The pagination was not linking to the previous result, it was loading everything which the previous result also does, which is why I was mistaken.
I thought that the data provider in the controller kept track of the result set but you have to keep resending the same criteria every time. I was sending the criteria the first time and not on subsequent results so it loaded everything in absence of any constraints. I simply put the search parameters in session and then retrieved them so they could be considered on every request and it fixed the problem.
In short there is no bug, just me being new working with Yii.

Content Query Webpart

I am using content query web part to display pages from pages library.
I want to configure my web part to display pages according to number of page views. most popular page (according to number of views) should be on top. Is it out of the box functionality in SharePoint 2010?
Simple answer: No, this is not included out of the box.
To achieve this, you need to add the number of page views to the page item, then sort by this number by using the Content By Query Web Part. This is not a out-of-the-box solution.
You can show the most popular pages using the rating system, but this is different than basing it on the number of views.

Yii Bootstrap Extension Gridview

I have been using CGridView without any issues previously but when I use Bootstrap extension the filters stop working.
Moreover the Ajax requests for CButtonColumn are set to use POST but when I use BootButtonColumn it uses GET and ignores the fact that ajax type is set to POST
Any ideas on how to fix the problems.
I went back to using zii widgets but today looking at the documentation for a totally unrelated reason I came across this property "ajaxUpdate". Below is the excerpt from Yii documentation.
ajaxUpdate property
public mixed $ajaxUpdate;
the ID of the container whose content may be updated with an AJAX response. Defaults to null, meaning the container for this grid view instance. If it is set false, it means sorting and pagination will be performed in normal page requests instead of AJAX requests. If the sorting and pagination should trigger the update of multiple containers' content in AJAX fashion, these container IDs may be listed here (separated with comma).
I am no longer using that extension but I am posting it here so that it maybe helpful to someone else.