ASP.NET MVC - how to get a full path to an action -
inside of view can full route information action?
if have action called dothis in controller mycontroller. can path of "/mycontroller/dothis/"
?
you mean using action method on url helper:
<%= url.action("dothis", "mycontroller") %>
or in razor:
@url.action("dothis", "mycontroller")
which give relative url (/mycontroller/dothis
).
and if wanted absolute url (http://localhost:8385/mycontroller/dothis
):
<%= url.action("dothis", "mycontroller", null, request.url.scheme, null) %>
Comments
Post a Comment