0

I use Bootstap table to present collection. In my table last column is button for details. After click on it, I want to display dialog, which will be filled by model from MVC action.

So, how can I do this:

  1. Click on button in row (there is <a href='MVC_action\ROW_ID'>
  2. MVC_action will be executed and return model
  3. Model is pass to view and dialog is visible with filled data.
Siguza
  • 21,155
  • 6
  • 52
  • 89
Jacek
  • 11,661
  • 23
  • 69
  • 123

1 Answers1

1
  1. Do not use <a href> for the button. That will make a refresh on the page. Instead, create a button and add a javascript event handler, like <button onclick="detail(ROW_ID)">
  2. The detail() function will call MVC_action\ROW_ID. The result from this call must be injected in a hidden div which handles the bootstrap dialog.
  3. MVC_action returns a partial view with the content of the dialog.
  4. After the injection, you must open the dialog.

Here you can see an example of an ajax call and a Bootstrap modal.

Greetings

Community
  • 1
  • 1
jparaya
  • 1,331
  • 11
  • 15