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

Popular posts from this blog

linux - Using a Cron Job to check if my mod_wsgi / apache server is running and restart -

actionscript 3 - TweenLite does not work with object -

jQuery Ajax Render Fragments OR Whole Page -