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
Post a Comment