I have a view that shows list of parties. every party has an ActionLink.
@Html.ActionLink("Edit", "Edit", new { id = 234 })
My action link goes to the edit action and renders an editor view.
The main idea is, on click of the ActionLink, a jQuery dialog box should appear with editor view and any edits in the view should be saved to database.
My problem is, I don't know how open a view in a jQuery dialog. So how would you open a view in a jQuery dialog?
If the same can be achieved without using ActionLink, that is also helpful.
You don't need to do all that messing around, try something like:
The key cheat here is the
href
attribute.Also bear in mind you can add the dialog to your desired page as follows:
And then include the following in your _Layout.cshtml:
Works for me :)
You could have your action return a partial view instead of full view, then read the documentation of the
jQuery UI dialog
and finally write the necessary code.Start by giving your anchor a class:
define a placeholder for your dialog:
make sure your controller action is returning a partial view:
and finally write the javascript to make it live:
Needless to say that you need to include the jQuery ui script after jquery as well as the necessary stylesheets.
you can do like this simple