构建ASP.NET Core音乐库及相关技术解析
1. 从ASP.NET调用TypeScript功能
在ASP.NET代码中,我们可以接入 searchDiscog 函数来获取图片。具体步骤如下:
- 首先,包含搜索脚本的引用:
<script src="~/js/discogHelper.js"></script>
- 然后,扩展图片部分以包含搜索脚本:
<td>
<img id="img_@index" width="150" height="150" />
<script type="text/javascript">
searchDiscog('@item.ResourceUrl', 'img_@index');
</script>
</td>
将这些整合起来,我们的Index页面现在看起来是这样的:
@{
ViewData["Title"] = "Home Page";
}
<div id="pageRoot">
<form asp-controller="Home" asp-action="Index" class="form-inline">
<div class="form-group
ASP.NET Core与TypeScript技术解析
超级会员免费看
订阅专栏 解锁全文
40

被折叠的 条评论
为什么被折叠?



