My Asp.net MVC partial view is designed for searching and makes an Ajax call to retrieve results. After the results are displayed, the user can select a search result by clicking on a link in one of the rows. Upon selecting a search result, an Ajax post request updates some state. Following this Ajax call completion, I aim to redirect to another page depending on the current page the user is on. Since this search partial view will be used on multiple pages with different redirect locations, I am struggling to find a solution that doesn't overly tie the partial view and hosting page together.
Another option might involve redirecting to another page after the selection Ajax call finishes, but wouldn't a redirect result within an Ajax call be ignored?
Alternatively, is there a way to include a button or link on each row that triggers a post request leading to a redirect result, based on the calling page?