开发者

route that will handle URL's in the URL for MVC 3

开发者 https://www.devze.com 2023-03-19 17:33 出处:网络
I am trying to create a custom route that can handle something like: domain.com/link/htt开发者_JAVA技巧p://www.someotherdomain.com/blablah.html?qstring=54

I am trying to create a custom route that can handle something like:

domain.com/link/htt开发者_JAVA技巧p://www.someotherdomain.com/blablah.html?qstring=54

Where the passed param is a link...

I cannot get this to work with URL encode and decode.. always returns a bad request?


Pass the link as id.

Something like...

controller:

public SomeAction(string url)
{
   ...
}

View:

@Html.ActionLink("link name", "Action", new {id = "someurl.com"}

or modify the global.asax's routes.MapRoute and add another parameter.

0

精彩评论

暂无评论...
验证码 换一张
取 消