Chapter 6. Working with Forms
If you experimented in the preceding chapter, you will have noticed that the scaffolded AuthorsController is fully functional in terms of adding, editing, and deleting records from the Author table. This in itself makes it quite useful; however, this chapter will demonstrate how to integrate Knockout and Bootstrap into the form as well as a little jQuery to submit the form via AJAX.
Upgrading Bootstrap
When I introduced the NuGet Package Manager, I mentioned updating the existing packages to their latest versions. The version that is installed with MVC is version 3.0 and some of the features used in this chapter (and future chapters) use the documentation from version 3.3.
If you didn’t update the packages back in Chapter 3, I would encourage you to do it now by following these steps:
- Right-click the project and select Manage NuGet Packages.
- On the left, select the Update option. This will search online for any updates to all of the packages currently installed.
- If you are comfortable with updating all packages, you can click the Update All button, or you can find just the Bootstrap package and update it individually.
Integrating Knockout with a Form
This chapter will start to demonstrate why I love working with these three technologies together. It’s going to take a nice-looking form and add some usability to it. In fact, no changes are required to the AuthorsController.
Back in Chapter 4 when the Author and Book models were created, I didn’t ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access