i need to get a Modal popup that displays a form which will save data back to the db.
is there is good example of doing it? is Ajax more flexible or using jquery dialog?
i need to get a Modal popup that displays a form which will save
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
I’ve used the JQuery UI Dialog plugin and use JQuery to load the modal dialog via ajax, and am quite happy with it.
I’ve had to hack up my code to give you something useful, so apologies for any syntax errors, but I use this jquery,
which binds a call to an ajax ‘get’ to the ‘click’ event of a link. The ajax get request returns a partial view from the corresponding action in my MVC projec, which then shows up in the modal dialog.
Here is a rough example of what the controller could look like
The view for the dialog would just be a normal partial view.
I use the following .css, which ‘greys out’ the page behind the modal dialog
You might need to muck around with the css for #ModalDialog to get it looking right,