c# - generate url inside view -


what need generate full url 1 of controllers inside view (so user can copy it). following:

    [get("invitationrequest/create")]     public actionresult execute()     { 

i need generate like: http://xyz.com/invitationrequest/create

i've seen answer: getting full url of action in asp.net mvc - job, if view , controller have same path. problem in case, view sits in different location - let's call http://xyz.com/mynetwork/generatelink

ok, i've found out why didn't work - problem areas. if controller in different area, needs specified:

@url.action("about", "home", new { area = ""}, request.url.scheme) 

in case, view in mynetwork area, , controller wasn't inside area @ - used empty string.

got answer one: url.action doesnt work non standard mvc route


Comments

Popular posts from this blog

html - How to style widget with post count different than without post count -

How to remove text and logo OR add Overflow on Android ActionBar using AppCompat on API 8? -

javascript - storing input from prompt in array and displaying the array -