首页 > 解决方案 > 如何在c#中将字符串变量绑定到锚标记的href

问题描述

我想在filenameTC 之前将字符串变量的值添加到 href 中,例如:

href="TC/'" @filename"'" target="_blank" style="color:White;"> Download TC

// code behind

filename = dr["filename"].ToString();

标签: c#asp.net

解决方案


<a href='@("TC/" + filename)' target="_blank" style="color:White;"> Download TC</a>

推荐阅读