tags:

views:

41

answers:

2

I have a set of views that display to specific users. These are views I've copied from other views in our app, and changed them slightly.

In these views I'm using Html.Action link, but I need these to return an absolute url instead of the relative. I know there are extra parameters that can be used to get this effect, but I dont tihnk its viable to change all my links in all my views.

Ideally I'de like to make a change in one place and have all my links render as required. Surely there must be something I can set, or a function I can override to accomplish this.

+2  A: 

You can create a new extension method called Html.AbsoluteAction. AbsoluteAction can add the extra parameters necessary to make the URL absolute, so you only have to write that code once, in your custom extension method.

Dave Swersky
As far as I know this is the only way to do this. Either way, you will have to update all your links for that to work. Not sure the rationale for having absolute links in an Html.Action...
Bryce Fischer
A: 

My HTML is being rendered by someone elses application. When they make request to our urls and they arent absolute, it tries to goto the path relative to their domain. They said they cannot change it on their side and so I would need to change it on mine