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
-
Create a new Controller named “Friend”.
-
Create a Model named “Friend” with following properties : FriendID,FriendName,Place
-
Create a Index (List of Friends) View and Method in Friend controller.
-
Update your model Friend for validation.
-
Make it FriendID as Required attribute.
-
Make it FriendName as Error Message = Friend Name Empty Not Allowed.
-
Make it Place entry resticted to Maximum Character = 25
-
Create a Insert new friend --> View and Method in Friend controller.
-
Insert new record with using Model in post.
-
Before Inserting check your Model means validate your model.
-
Create edit/Update View and Method in Controller.
-
Update record with using FormCollection technique.
-
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:
-
ADO.NET code
-
Linq To Sql
-
Entity Framework
Following are the other links.