Issue with UrlHelper
cadilhac opened this issue · 4 comments
Hi,
I try to generate a link inside a template, using:
@Url.RouteUrl(<routename>)
RouteUrl returns null.
Thanks
Hi, Please assist with more info:
.NET Version:
Project Type:
Razor.Templating.Core Version:
Expected Output:
Sample repo to reproduce(if possible):
Hi @cadilhac, I had a look. @Url.RouteUrl
will work only in MVC app as it requires the routing features which is not supported by the library.
A quick workaround is to call @Url.RouteUrl
from the controller action method & then pass it to the ViewModel.
Hope it helps. Thanks.
Yes. Sorry, I had not been able to create a repro yet. And yes, I'm using MVC and was already creating the link in the controller as a workaround. Sad that you can't solve it. Cheers.
I've updated the documentation that UrlHelper is not supported. Hence closing. Please feel to reopen if there are any suggestions.
Thanks :)