c# - 如何在c#中将字符串变量绑定到锚标记的href
问题描述
我想在filename
TC 之前将字符串变量的值添加到 href 中,例如:
href="TC/'" @filename"'" target="_blank" style="color:White;"> Download TC
// code behind
filename = dr["filename"].ToString();
解决方案
<a href='@("TC/" + filename)' target="_blank" style="color:White;"> Download TC</a>
推荐阅读
- php - 验证 mailchimp 的 url 的 GET 状态
- swift - 发生这种情况时如何检测 UIImageView 中的更改并更改布尔值
- gatsby - 如何将 google Adsense 添加到 Gatsby 网站?
- excel - 组合框事件未触发
- ios - 如何在 fastlane 中处理多个 iOS 目标(小部件)
- javascript - JavaScript中十进制数字与货币的智能比较功能
- django - Django模型不保存
- c# - C# 中的 MessageBox、锁和 System.Windows.Forms.Timer 问题
- windows - 并发 MIDI 和 BLE 通信的 WinRT/C++ 问题
- python - 在 Django 中,如何保护 Graphene GraphQL 端点以供 API 使用?