Click here to Skip to main content
15,896,912 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
<a href="@string.Format(%20@items[10])">

above is my code i am getting value in @item[10] URL Like www.ggg.com so i want to give link on this value so kindly guide me how to give link

What I have tried:

how to give link on database value
Posted
Updated 20-May-17 0:07am
v2

1 solution

Since this link is not your own local link, under the same domain, you would require to use the protocol with it as well. Try using this,
C#
var url = "http://www.ggg.com";

<a href="@url">Awesome Domain</a>

The type of variable doesn't matter — static variable like var url or string[] list — what matters is what gets loaded there. So, just a tip trick,

1. Use http protocol for external URLs.
2. You can use "~" for local paths as well.
3. Follow a standard of URLs, that helps creating hyperlinks for internal files and external files; using http, vs local physical path etc.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900