Skip to content

'ViewContext' does not contain a definition for 'Controller' #1060

Description

@Halofreak1990

For purposes of learning the new MVC 6 framework, I am in the process of converting a basic MVC 5 project to MVC 6. However, this project uses a few custom HtmlHelper extension methods, some of which use the Controller property of the htmlHelper's ViewContext to retrieve an UrlHelper instance to build an URL based on the passed 'action' and 'controller' parameters. This, however, produces the titular error message.

Was the omission of the Controller property an oversight or intentional, and if intentional, what do you suggest as workaround?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions