0

How do you dynamically open a modal dialog window on click from a list of items and passing parameters to a partial view. For example, I have a list of items. When the user clicks on one of the items I want to open a modal dialog window that dynamically (goes to the controller, etc.) displays the information for that particular item on the list. I don't want to and can't do a render of the partial views when the page loads and just hide them until a user clicks the link. I tried that and there is too much javascript in the partial view that the id's are the same because of the many items in the list. The dialog for the partial view has to be dynamically loaded when a user clicks the link for the specific item.

user2974739
  • 619
  • 1
  • 7
  • 20
  • Nope. It's not the same thing I am asking. I don't want to send the data back as html to display. I already have the partial views created. They just need to be called on click of the link and dynamically display the results in a modal dialog. From the link you sent I how would I be able to call the partial view with the parameters I want for each link? – user2974739 Sep 02 '15 at 22:56
  • The answers in the provided link explain how.... If you don't want to do it on page load, and you don't want to fetch via AJAX, how exactly are you planning on doing it? – Brad Werth Sep 02 '15 at 22:58
  • So, let's say I do it via AJAX - are you saying I would have to return an HTML equivalent of what I want to display to the user? – user2974739 Sep 02 '15 at 23:00
  • Yep, exactly. It's the only way, except magic, if it's not rendered in the page in advance. – Brad Werth Sep 02 '15 at 23:01
  • I guess I need to figure out how to properly render it on pageload. Thanks, – user2974739 Sep 02 '15 at 23:03

0 Answers0