C# 如何在 MVC 4 中创建图像按钮
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/17610391/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-10 10:01:13 来源:igfitidea点击:
How to create an Image button in MVC 4
提问by Swifty
How do you create a plain old image button in MVC 4 (Razor)?
I'm looking for something like this

你如何在 MVC 4 (Razor) 中创建一个普通的旧图像按钮?我正在寻找这样的东西

采纳答案by shamcs
try this
尝试这个
@using (Html.BeginForm("ActionTaken", "TestController")) {
<button name="button" value="ActionOne" class="button" style="width: 200px;">
<img src=""/></button>
<button name="button" class="button" style="width: 160px;" value="ActionTwo">
<img src=""/></button> }
回答by Alexandr Mihalciuc
Add this to your razor view:
将此添加到您的剃刀视图中:
<input type="image" src="<image path here>" alt="Submit" width="48" height="48">

