Click here to Skip to main content
15,884,836 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
See more:
Hello,

I use Bootstrap 3.3.7.

My goal is to pick a user in a bootstrap modal that shows a paginated users list.

I have a controller User with an action Select that have a page parameter.

For exemple, User/Select/1 return a partial view with the 20 first users. User/Select/2 return a partial view with the 20 next users and so on.

The main view has a modal-container and an @Html.ActionLink to User/Select/1 with data-target=myModalId and data-toggle='modal'.

When i click on the link, the modal shows the first 20 users and when i click on a user i get it's id via javascript and the modal closes. Everithing is OK.

The problem is when i click on a page number to search a user that is not on the first page.

All numbers are @Html.ActionLink to User/Select/page_number with data-target=myModalId and data-toggle='modal'.

When i click on a page number the action Select from the controller User is called with the good page number but the partial view returned by the action is not displayed in the modal => the modal closes and the partial view is displayed at the place of the main view.

Is there a solution to keep the modal open and display the clicked page in the modal ?

Thanks for your help.

Michel

What I have tried:

I tried to add class page-clicked to the page links and handle the click with this class in a script that preventsdefaut() to stop the action call and then call the action with a jquery post and then show the dialog => the action is called, the screen became gray but no popup is displayed.
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900