I'm trying to pass u url as parameter to a get method. I defined a route that accepts a {*url} parameter so I can send "/" characters without it separating my parameter. As soon as there is a ":" in the url (like in http: or localhost:3857 for example), the method never gets hit.
The Html.ActionLink method escapes it's parameter itself, but it doesn't seem to escape the ':'. I cannot escape it manually because then the escape characters get escaped by the very same Html.Actionlink method.
any ideas?
A URL parameter is a way to pass data in a link to a web page. You can use URL parameters to track different metrics in services like Google Analytics or Google Ads, and in Unbounce to pre-fill your form.
Any word after the question mark (?) in a URL is considered to be a parameter which can hold values. The value for the corresponding parameter is given after the symbol "equals" (=). Multiple parameters can be passed through the URL by separating them with multiple "&".
In a GET request, you pass parameters as part of the query string.
To identify a URL parameter, refer to the portion of the URL that comes after a question mark (?). URL parameters are made of a key and a value, separated by an equal sign (=). Multiple parameters are each then separated by an ampersand (&).
Use EncodeUrl before you pass it, and then decode it on the other side.
I ran into the same problem. I ended up removing the Html.ActionLink and replaced it with:
<a href="[email protected]">@item.Title</a>
@item.ID is a url returned from the netflix api, example http://api.netflix.com/catalog/titles/series/70021357/seasons/70021357. Now my url looks like this - /Home/Movies?id=http://api.netflix.com/catalog/titles/series/70021357/seasons/70021357, and I just used Request.QueryString to get the value in the controller:
Request.QueryString.Get("id")
Probably not ideal but it works for now.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With