I work with asp.net core 2.2 (self hosted kestrel) - my app is a public portal.
I have a problem, that I don't understand...
In the app, the user can enter and store the address to his home page.
Normally this would be www.xx.yy (not matter, if it is http or https).
On a view, I have:
<a href="@Model.cPAB_Internet" target="_blank" class="btn primary btn-primary BS_AktionsButton" >
<i class="fas fa-globe-europe"></i> Homepage aufrufen...
</a>
This shows a bootstrap button with an icon, whereby @Model.cPAB_Internet contains the stored link.
Problem:
If the link only contains www.xx.yy and the button is clicked, automatically the host name and root is added before the link - e.g. http://localhost:14300/www.xx.yy and the page don't load as it is searched internally (controller method).
If the link is https://www.xx.yy, it works, if the link is http://www.xx.yy, it works and also, if the link is //www.xx.yy it works.
I have added (as bad workaround for now), that the users have to enter http:// or https:// bevor the domain, but this is not user friendly (a lot of users may not know, if they have a http or a (encrypted) https site...)
Questions:
In any browser, I can type in www.xx.yy and the browser resolves the correct link...
- Why does this not work in a asp.net core view?
- Is there a workaround, to bring that to work?
Thanks for any answer.