I am somewhat new to this and I am having trouble displaying a page which contains partial views and I want someone to look over my structure and maybe point out what I am doing wrong.
This is my main page in which I will display other razor page contents int it.
PROFILE PAGE:
@model Project.Models.PasswordModel
@{ ViewBag.Title = "Profile Page"}
//right column
@if(ViewBag.HasLocalPassword)
{ @Html.Partial("passwordChange") }
else { @Html.Partial("passwordSet")}
//left column
@Html.Partial("username")
@Html.Partial ("biography")
when I created the username and biography razor view pages this is what I had in the "Add View" box:
View engine: Razor(cshtml) only the "Use a layout or master page: " was checked and the box underneath was left empty ( Leave empty if it is set in a Razor _viewstart file)
When I render the whole page all different parts are displayed but the username and biography areas are supposed to be filled with data from the database which isn't doing that. Only when I change the url to actually direct to username page that the proper information from the database is being displayed.
when I click on the change password button after entering new password information I get this error message:
The model item passed into the dictionary is of type 'Project.Models.PasswordModel', but this dictionary requires a model item of type 'Project.Models.UserNameModel'.
any help to how I can properly display different razor view pages into one or the right structure please help me out.