question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Cannot use HtmlHelper from view

See original GitHub issue

Using @Html.Raw("<span>test</span>") returns a TemplateCompilationException. With internal error message “The name ‘Html’ does not exist in the current context”.

I assume you need to setup the HtmlHelper<TModel>() for it to work? Any other way i can pass inn a Html string from a model?

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:1
  • Comments:14 (3 by maintainers)

github_iconTop GitHub Comments

3reactions
toddamscommented, Oct 25, 2016

I will add html helpers support in the future, so you won’t see this annoying errors, but for now - you should deal with it)

2reactions
jjxtracommented, Mar 1, 2019

It’s been 2.5 years, still no html.raw capability. What is needed to add this?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Why can't I use Html helper methods with strongly-typed ...
This error happened to me because I moved by mistake the web.config that was inside the "Views" folder. This file contains the include...
Read more >
Tag Helpers in ASP.NET Core
cshtml file makes the Tag Helper available to all view files in the Views directory and subdirectories. You can use the @addTagHelper directive ......
Read more >
HTML Helpers In ASP.NET MVC 5
Inline HTML Helper is used to create a reusable Helper method by using the Razor @helper tag. Inline helpers can be reused only...
Read more >
Cannot declare class Cake\View\Helper\HtmlHelper
Hi to the community, I am trying to send an email with Cake\Mailer\Email; and when executing the script, I have the following error:...
Read more >
Moving to ASP.NET Core: Replacing HTML Helpers that ...
In some cases, the HTML Helper code above is inside a Nuget package or is compiled code that the caller can't access. When...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found