Reputation: 36166
I'm writing my own helper and it needs to get a path as a parameter. I can of course refer to it directly passing a string or using Url.Action(). But what if I want to generate fully qualified URI inside of my helper method using action, controller and route values?
It does look a little bit messy right now
@Ajax.MyHelper(Url.Content("~/Admin/Administration/DeleteItem?Id=<#= Id #>"))
Upvotes: 0
Views: 268
Reputation: 887449
Inside the helper, you can call
new UrlHelper(ajax.ViewContext.RequestContext).Content(...)
Upvotes: 2