0

In my view I'm giving a URL out like this:

<td style="border-bottom: solid 1px #f3ad44" align="center">
    <a class="actions" href="<%= item.URL  %>">www...</a>
</td>

My problem is that item.URL has a value like: www.hello.com but when i click on it from webpage it navigates to http://localhost:64075/www.hello.com.

How can I avoid of using localhost, and actually navigate to http://www.hello.com?

2 Answers 2

6

Make sure to prefix the url with the proper protocol (such as http://), either inside item.URL or in the markup: [...] href="http://<%= item.URL %>">[...].

Sign up to request clarification or add additional context in comments.

Comments

0
<td style="border-bottom: solid 1px #f3ad44" align="center">
     <a class="actions" href="#" onclick="window.open('http://<%= item.URL  %>'); return false;">www...</a> 
</td> 

<td style="border-bottom: solid 1px #f3ad44" align="center">
     <a class="actions" href="#" onclick="window.location='http://<%= item.URL  %>'; ">www...</a> 
</td> 

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.