mtrutledge / generator-dnn

Yeoman generator to scaffold DNN / DotNetNuke Modules and Themes.
MIT License
17 stars 10 forks source link

[MVC] Settings Page is Broken #25

Closed SkyeHoefling closed 6 years ago

SkyeHoefling commented 6 years ago

After creating a MVC Module with the generator everything works as expected. When I install the module and goto the settings page it crashes with a DNN Error:

image

SkyeHoefling commented 6 years ago

This is because the Settings.cshtml file is not being generated correctly. The notes below are from my personal experience with DNN MVC and may not be accurate but I believe they are accurate.

The model is not being declared correctly at line 1 of the file. @model syntax works for MVC but in DNN MVC we should use the following syntax:

@inherits DotNetNuke.Web.Mvc.Framework.DnnWebPageViewPage<Settings>

This will properly populate the Model object for use in the view.

The markup is referencing a CurrencyCulture which is not defined anywhere.

To fix this problem we just need to update the cshtml to reference the correct model and the correct properties on the model. I will submit a PR

mtrutledge commented 6 years ago

I fixed this earlier today and will push the code up.