MvcContrib FluentHtml With Razor?

I am wondering if the latest version of MvcContrib works with the Razor view engine? I referenced the MvcContrib assembly and the FluentHtml assembly, then I added the required namespace to ~ / View / Web.config, as suggested here by Darin. But still, no matter how hard I try to use the FluentHtml extensions in my views, this will not work. (nothing shows up in intellisense when I start from the point after the html helper)

Did I miss something?

PS: this is the first time I use MvcContrib.

+4
source share
2 answers

I wrote a short blog that publishes covers using FluentHtml with Razor .

As for intellisense, you will get intellisense for the FluentHtml methods on "@this". (not "@Html."), and it only displays syntax helpers in views that implement IViewModelContainer <T> (for example, ModelWebViewPage <T>). Another possible problem is Resharper. There is a workaround for this.

+5
source

I use mvccontrib and after responding to darin, it should work. The following steps followed:

  • copy mvccontrib.dll and mvccontrib.fluent.dll to the bin folder

  • make a link in the links to these dlls, creating a link for mvccontrib and mvccontrib.fluent.

  • two namespaces with the following names:
    add namespace = "MvcContrib" add namespace = "MvcContrib.FluentHtml"

  • in my controller, I enable the use of MvcContrib.Pagination;

  • Finally, I used in my opinion: @using MvcContrib.UI.Pager @using MvcContrib.Pagination

and rebuild. hope this helps.

0
source

Source: https://habr.com/ru/post/1345378/


All Articles