Creating CRUD Application with ASP.NET MVC 5, AngularJS, BootStrap 3, and HTML5 - Part 5

Part 5 – The Add, Update, and Delete modules

We already have the skeleton and we already tried pulling data from the back end.  The next things would be easier. All we have to do is add more  functions to our existing modules.


Download the Complete Source Code


Lets get going:
  1. On the ContactController.cs (ASP.NET MVC - back end). Add the methods for AddContactUpdateContact, and DeleteContact.
    See the code snippet below.
  2. Under the App->DataService folder, edit the contactDataService.js to support add, edit, and update functions.
    See the code snippet below.
  3. Under the App->contact->controller folder, edit/replace the contactController.js with code snippet blow.

  4. Open the contactForm.html under App->contact->html. You can replace it with the code snippet below or edit the Cancel, Save and Delete portion to work with the contactController.
  5. Open the clientRoute.js under App folder.
    Add the controller for the contactForm. After this, you can start adding contacts.

Finalizing the Edit Module
  1. Open the contactsList.html under App->contact->html folder.
    Go to the Table tag add 1 column for the Edit button. See code snippet below.
  2. Open the clientRoute.js under App folder.
    Add the route for the edit function.

Finalizing the Delete Module
The delete module is incorporated in the edit module. The delete button will show as long as the user does not  edit any data. It uses modal for confirmation.

Let's finalize it.
Add the deleteModal.html template under App->contact->html folder.

Ok. Finally. It's Done.

I hope this is a great help specially if your starting with Angular and ASP.NET MVC. Please leave comments.

28 comments

When I add or delete a record, in the console, I get this error:

[$rootScope:infdig] 10 $digest() iterations reached. Aborting

Why this is happening?

Reply

Hi iam very new to angular js and asp.net MVC .. is it ok to use MVC rather than web API

Reply

This is the best article for angularjs with MVC5...Please share code for master details crud with angularjs

Reply

Hi, Nice update. After reading I know how to create CRUD application using Asp.net Mvc and other applications. I have a little bit idea about Asp.net MVC from "myasp.net",which is a good hosting site. I hosted my website there. Thanks for sharing and keep blogging new updates like this.

Reply

I have got an error in running your full project.
Error is :

A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL.

I know the cause but don't know the solution in mvc 5. where the i have to call the connection string. the error gets in JsonController class line no: 24.

What is the solution?

Thanks in advance.

Reply




Hey, nice site you have here! Keep up the excellent work!



Angularjs 2 Development Company

Reply

lan aq usagi, source nerede ??

Reply

Excellent --- Question, what changes are required to make to test the app against SQL Server (besides the web.config connection)

Reply
This comment has been removed by the author.

It is nice blog Thank you provide important information and I am searching for the same information to save my time AngularJS5 Online Training

Reply

Wow such a nice post which you uploaded here. Thanks for sharing so nice article. It really helps me out.
Angularjs Development Company |
Hire Angularjs Developer

Reply

Nice tutorial. Thanks for sharing the valuable information. it’s really helpful. Who want to learn this blog most helpful. Keep sharing on updated tutorials…
python training in chennai
python course institute in chennai

Reply

This is most informative and also this post most user friendly and super navigation to all posts... Thank you so much for giving this information to me.. 
python training in chennai
python course institute in chennai

Reply

Thank you for taking the time to provide us with your valuable information. We strive to provide our candidates with excellent care and we take your comments to heart.As always, we appreciate your confidence and trust in us

Java training in Pune

Java interview questions and answers

Java training in Chennai | Java training institute in Chennai | Java course in Chennai

Java training in Bangalore | Java training institute in Bangalore | Java course in Bangalore

Reply

Thanks for your informative article, Your post helped me to understand the future and career prospects & Keep on updating your blog with such awesome article.
Best Devops Training in pune
excel advanced excel training in bangalore

Reply

Hiiii....Thank you for sharing Great information...Nice article....Keep Going on
Best Angular JS Training in Hyderabad

Reply

Really very nice blog information for this one and more technical skills are improve,i like that kind of post.
salesforce Training in Bangalore
uipath Training in Bangalore
blueprism Training in Bangalore

Reply

This blog has very useful information about this topic which i am searching now, i gather some information from reading your blog
salesforce Training in Bangalore
uipath Training in Bangalore
blueprism Training in Bangalore

Reply

Thank you so much for sharing this excellent information. Your article is amazing. Good to discover your post. We are the Best

salesforce Training in Bangalore
uipath Training in Bangalore
blueprism Training in Bangalore

Reply

Good post!Thank you so much for sharing this lovely article.It was so good to read and useful to upgrade my understanding...
aws Training in Bangalore
python Training in Bangalore
hadoop Training in Bangalore
angular js Training in Bangalore
bigdata analytics Training in Bangalore




Reply

Creating a CRUD application with ASP.NET MVC 5, AngularJS, Bootstrap 3, and HTML5 offers a streamlined approach to modern web development. Just as a Blade runner coat symbolizes style and functionality in a futuristic setting, this tech stack combines robust frameworks for a sleek, user-friendly experience, making it ideal for dynamic applications.

Reply