Hi,
I am newbie in MVC my problem is that, my friend has developed project admin side, and I should develop web side
Now, my structere look like
-MODEL
-CONTROLLER
-VIEW
--Areas
---Admin
---Web
now inde admin and web which use same model and controller admin works normal, there is no error
but for example, I create index.cshtml within Web Areas and I wrote this code
<table class="table">
<tr>
<th></th>
</tr>
@foreach (var item in Model) {
<tr>
<td>
@Html.Label(item.TypeName)
</td>
</tr>
}
</table>
this is my _UsersType partial view cshtml and I used this partial in index but always Model return null where is the my problem?
and also my routeconfig look like
routes.MapRoute(
name: "AdminDefault",
url: "Admin/{controller}/{action}/{id}",
defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional }
).DataTokens.Add("Area", "Admin");
routes.MapRoute(
name: "Default",
url: "{controller}/{action}/{id}",
defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional },
namespaces: new[] { "Otoneov2.Presentation.Mvc.Controllers" }
).DataTokens.Add("Area", "Web");