toddams / RazorLight

Template engine based on Microsoft's Razor parsing engine for .NET Core
Apache License 2.0
1.52k stars 259 forks source link

UrlHelper access #477

Closed cadilhac closed 2 years ago

cadilhac commented 2 years ago

Using asp.net core 6.

Is it possible to access a UrlHelper in a template so that I can generate a url? Intellisense recognizes @Url.RouteUrl(... but I get an exception at runtime: The name 'Url' does not exist in the current context. I tried adding @using Microsoft.AspNetCore.Mvc but it does not help. Thanks

jzabroski commented 2 years ago

Duplicate. Please search issues before posting

https://github.com/toddams/RazorLight/issues?q=is%3Aissue+is%3Aopen+url

cadilhac commented 2 years ago

I had searched the exact same results you show me. And I read at that time "Work on UrlHelpers is in progress, expect in a nearest release". It was a long time ago and there was new releases since then. So I thought it was relevant to ask again. Seems this is not implemented if I understand correctly.