Hello, I need to pass a full website url to my controller action, like this:
http://myweb/controller/action/http://blabla.com/dir2
how to create a new route for passing this parameter to action?
Hello, I need to pass a full website url to my controller action, like this:
http://myweb/controller/action/http://blabla.com/dir2
how to create a new route for passing this parameter to action?
routes.MapRoute("Name", "{controller}/{action}/{*url}");
Additional Info:
Pass it as a parameter.
<%= Html.ActionLink( "Link",
"MyAction",
"MyController",
new { url = "http://blah.com/blah" },
null ) %>
Should produce a link that looks like:
<a href='/MyController/MyAction?url=http://blah.com/blah'>Link</a>
Your action would look like:
public ActionResult MyAction( string url )
{
...
}