Closed sholman closed 5 years ago
Adding this reference only solves part of the issue, as the intellisense on the @Dnn and @Url functions doesn't work without a model inheriting from DotNetNuke.Web.Mvc.Framework.DnnWebViewPage
Every view should have the following command:
@inherits DotNetNuke.Web.Mvc.Framework.DnnWebViewPage
or
@inherits DotNetNuke.Web.Mvc.Framework.DnnWebViewPage<Model>
If it doesn't and it is part of the template either create an issue or create and issue and submit a PR. We are trying to fix them as we see them but there could be views missing the declaration in the template
Describe the bug
Newly created projects show intellisense errors in views due to missing DotNetNuke.Web.Client reference and missing model declaration
To Reproduce
Steps to reproduce the behavior:
Expected behavior
A new project should not show intellisense warnings
Screenshots
Errors
See Screnshot
Additional context
This can be resolved by adding DotNetNuke.Web.Client to the initial package list to be loaded as references and adding a blank Model declaration such as @inherits DotNetNuke.Web.Mvc.Framework.DnnWebViewPage as the DNNHelpers like @Dnn. and @Url. load from DotNetNuke.Web.Mvc.Framework.DnnWebViewPage
*Note: The blank model declaration of type string may cause other issues if you try to render a named view from the controller as it see's the view name as the model, so this may not be the most bulletproof resolution.