Lab Exercise: Check Your ASP.NET MVC Knowledge

Lab exercise

Write your anwser in step by step and take screen shot of those steps.

Lab Practice Question for Asp.Net MVC for very beginner

  1. Create a new Controller named “Friend”.

  2. Create a Model named “Friend” with following properties : FriendID,FriendName,Place

  3. Create a Index (List of Friends) View and Method in Friend controller.


  4. Update your model Friend for validation.

  5. Make it FriendID as Required attribute.

  6. Make it FriendName as Error Message = Friend Name Empty Not Allowed.

  7. Make it Place entry resticted to Maximum Character = 25

  8. Create a Insert new friend --> View and Method in Friend controller.


  9. Insert new record with using Model in post.

  10. Before Inserting check your Model means validate your model.

  11. Create edit/Update View and Method in Controller.

  12. Update record with using FormCollection technique.


  13. Create Delete view and Method for delete a friend in post method of Controller.

Peform above all data CRUD (Create Retrieve Update Delete) activities in following ways:

  1. ADO.NET code

  2. Linq To Sql

  3. Entity Framework

Following are the other links.

Ebook Download
View all
Learn
View all