I see the issue does not exist when URL begins with http or https
Hence right now i have to check whether the URL begins with https and if not, adding it before URL.
But i know its not an optimal solution
How can i solve this...?
That is the only solution unless you write an extension method for the Link class to wrap the check up in reusable code. Because the URL picker allows people to write their own URLs in it's tricky to handle.
You could put a custom validation event in the back office to pick up the check before it gets to front end rendering.
Error when http or https is not given with URL in URL Picker
Hi Guys..
I'm accessing a link from URL Picker using the code below
-->
var relatedLink = item.Value<Link>("relatedLink");
and I'm using an anchor tag to go to that URL
-->
<a href="@relatedLink.Url" >
but when i gave a URL as "www.google.com" the URL is loaded along with current page for eg : http://www.mysite.com/www.google.com
I see the issue does not exist when URL begins with http or https
Hence right now i have to check whether the URL begins with https and if not, adding it before URL. But i know its not an optimal solution How can i solve this...?
Hi Arun,
That is the only solution unless you write an extension method for the Link class to wrap the check up in reusable code. Because the URL picker allows people to write their own URLs in it's tricky to handle.
You could put a custom validation event in the back office to pick up the check before it gets to front end rendering.
Nik
Thanks Nik.. :)
Right now i have given a message to the user to input the full URL
is working on a reply...