-
Notifications
You must be signed in to change notification settings - Fork 78
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
Ajax modal not displaying correctly #417
Comments
Could you please show the issue in a sample project? |
Thank you very much for responding so quickly. I have attached an MVC5 very basic web application. It basically mimics what you posted in stackoverflow. On the Index page I have a grid that uses AJAX for opening the modal. I also included a simple button demonstrating opening a modal in a non-AJAX manner. Both are examples that you are familiar with because you wrote the code. You should see pretty quickly what I'm talking about in the AJAX version. |
Hi Dmitry, I think I know what the issue is. I determined that the PartialView "GetPersonInfo" needs to be wrapped with 2 DIV's (one with a class of "modal-dialog" and one with a class of "modal-content"). So now the question is, what is the appropriate syntax that I should use in the partial class?
|
Thanks for the sample app. I quickly found the issue and updated answer on StackOverflow. return View("GetPersonInfo", model); to: return PartialView("GetPersonInfo", model); Second, in the var m = $('#modal-person');
m.find('.modal-content').html(data);
m.modal('show'); This should be it. Let me know if you still have issues. |
Please forgive me because this is the first time I've used TwitterBootstrapMVC. I am using Dimitry's recommended approach listed here for loading up a modal form:
http://stackoverflow.com/questions/16011151/mvc-4-edit-modal-form-using-bootstrap/19039695#19039695?newreg=8f7857ae5e92417fa88be962d169e67d
When I run this sample, I do get a modal that I can dismiss, but the modal is nearly as wide as the browser window and has a transparent background. When I run some of the samples of opening a modal (not using AJAX), everything appears to work great. But opening the modal using the helper method, things just don't look right at all.
Any suggestions?
The text was updated successfully, but these errors were encountered: