我是 mvc 的新手。我动态创建了 html 按钮,我无法为这些按钮分配操作
代码是:
sb.Append("<li style=\"margin:17px;\">");
sb.Append("<img src=\"" + path + "Content/HeaderSlides/FullImages/"
+ imagename + "\" width=\"180\" height=\"100\"/>");
sb.Append("<input type=\"button\" name=\"deleteimage" + id
+ " \" id=\"btndelete" + id
+ "\" value=\"Delete\" class=\"t-button t-grid-delete\" "
+ " style=\"margin-left:10px;\" />");
我想让html按钮像这样:
<input type="submit"
title="Delete"
value="Delete"
name="btndelete"
onclick="location.href='@Url.Action("DeleteHeaderSlide",
"HeaderSlides",
new { filename = "Sunset.jpg" })'" />