0

assume I have an Edit.cshtml view in an asp.net-mvc 5 application with a form of many text boxes for editing properties.

I want to have a link e.g. @Html.ActionLink or @Html.AjaxLink (not sure which way is the correct way of doing it) when clicked, will grey out the current view and put it in the background, and add a partial view to the foreground with a form with more texboxes to edit (and has a save button for submitting the form)

What is this process called and how do I do this?

John Saunders
  • 160,644
  • 26
  • 247
  • 397
Abdul Ahmad
  • 9,673
  • 16
  • 64
  • 127
  • 4
    Sounds like what you want is a modal, probably populated using AJAX. There are a lot of different plugins for modals. When the Edit form is submitted you'll need some custom logic to submit it via AJAX and then somehow refresh the background view. – Nick Bork Oct 07 '14 at 16:47
  • Just looked it up, yea thats exactly what I want, googling now, thank you for the tip! – Abdul Ahmad Oct 07 '14 at 16:50
  • 1
    it's a good solution for you - learn basic level: http://try.jquery.com/levels/1/challenges/1 – Marek Woźniak Oct 07 '14 at 17:00
  • @NickBork can you add your comment as an answer so I can accept it? – Abdul Ahmad Oct 20 '14 at 18:16

1 Answers1

2

The most common implementation of this would be a modal such as Fancybox or if you happen to be using a Bootstrap template with your MVC project you can use the modal feature described by the doc.

If you're loading the form into a Modal window you'll likely want to capture the submit event of your form and use AJAX to submit it instead so you stay on the same page. If so, there are some known issues and work around with client side validation not working like this.

Community
  • 1
  • 1
Nick Bork
  • 4,831
  • 1
  • 24
  • 25