Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not Support auto Search? #25

Closed
John0King opened this issue Sep 1, 2016 · 3 comments
Closed

Not Support auto Search? #25

John0King opened this issue Sep 1, 2016 · 3 comments

Comments

@John0King
Copy link
Contributor

Current I must define asp-action ,asp-controller,asp-route-* for a search. Is this a Bug?
it should support auto parse QueryString to those links

@joeaudette
Copy link
Collaborator

I don't consider it a bug that you have to provide routing information such as controller action and route params. you have to do that also for anchor tag why should this be any different? I don't think it should auto parse anything from the url of the current request or make any assumptions about ambient query string params.

@John0King
Copy link
Contributor Author

anchor tag is for a specific url: one link for one page, difference querystring might have different content. But this library Pagination is for a list to move next or forward, so it's very important to make sure it's the same list between (Next Page or Previous Page) and current Page. Another reason is that to preserve the search queryString in action,viewBag,and Pagination for every action is very hard (multi search box).

(John0King@0836ecd)

@joeaudette
Copy link
Collaborator

yes you should preserve the needed params in your viewmodel (from the current request) and use it to pass the route params to the pager, the pager should not try to guess what you want.

If you want an example, I'm using it for search in a number of places in cloudscribe Core project, for example in role administration to search for roles and role members and role non members. In all cases I'm providing the needed route parameters to the pagertaghelper from my viewmodel

Example view, viewmodel, controller

it is your job to pass what you need for routing it is not the job of the pagertaghelper to try to guess it.

if you want that you can always fork the project and implement it as you think it should be

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants