Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我想将网站地址存储在数据库中的表中,即“ http://some_website.com ”或“some_website.com”。然后在视图中我可以通过“Model.Website”访问文本。如何生成超链接?有帮手吗?
Simply embed the model properties in a hyperlink element appropriately:
public class YourModel { public string Href { get; set; } public string LinkText { get; set; } }
...
<a href="@Model.Href">@Model.LinkText</a>