Url.action ASP.NET how to redirect?

I want to redirect a link using url, action (...) to an external site http://external.com/Page.html

How to do it in ASP.NET?

+3
source share
1 answer

Since the local ASP.Net site does not have knowledge of the external site, just enter your code in plain HTML:

 <a href="http://external......">....</a>

If you need to calculate the parameters:

 <a href="http://external......?<%= MyParamsCorrectlyEncoded() %>">....</a>

If you use MVC (your question mentions Url.Action), you can use AttributeEncode to encode attributes to an external site.

+2
source

Source: https://habr.com/ru/post/1765770/


All Articles