ASP .NET 应用程序 - 添加图像而不是文本到 asp-route-returnUrl

ASP .NET Application - add image instead of text to to asp-route-returnUrl

我想在路由中添加一些图片而不是文本。 我该怎么做?

我的示例如下:

 <form id="logoutForm" class="form-inline" asp-area="Identity" asp-page="/Account/Logout" asp-route-returnUrl="@Url.Action("Index", "Home", new { area = "" })">
        <button id="logout" type="submit" class="nav-link btn btn-link text-white">Logout</button>
    </form>

我想在注销文本位置有一个图像。 我想不通。有人可以帮我解决这个简单的事情吗..?如何用图像替换按钮?我尝试了很多 img scr 等。但总是出问题,而且没有用。

有多种方法可以做到这一点,我更喜欢简单地将图像放入按钮中:

<button id="logout" type="submit" class="nav-link btn btn-link text-white">
    <img src="logout_button.png">
</button>

参见:Embed image in a <button> element