Edit View Page
Now, we want to populate the view of edit page. Actually, the content is same as view from Add page. If we too lazy, we could just copy and paste it. Not in Makers Institute.
I would like to introduce you about Partial View.
Partial View works with reusing the view page so it could be used with different purpose.
- Right-click at Entries folder in View folder > Add > View.
- Change the view name to _EntryForm.
- Tick on "Create a partial view".
- Copy the @model and @using from Add view page.
- Then, copy paste the remaining code from @using(Html.BeginForm()).
- Finally, we just call the Partial view with this code.
@Html.Partial("_EntryForm")
- Do this method in Edit View too.