我目前正在学习ASP,但我无法将View中的ActionLink链接到Controller中的ActionResult。 这是我的代码:
ViewFiles.cshtml
@Html.ActionLink("Download", "Download", "UploadController")
UploadController.cs
public ActionResult Download()
{
return Content("<script language='javascript' type='text/javascript'>alert('Hello world!');</script>");
}
我现在只是尝试返回警报以查看它是否有效但我收到HTTP 404错误。
答案 0 :(得分:2)
将 UploadController 更改为上传:let annotationView = MKMarkerAnnotationView(annotation: annotation, reuseIdentifier: identifier)
let rightButton = UIButton(type: .detailDisclosure)
rightButton.setImage( UIImage(named: "map1"), for: .normal)
annotationView.rightCalloutAccessoryView = rightButton
试试这个(在ActionResult上返回JavaScript结果):
@Html.ActionLink("Download", "Download", "Upload")