大家好,当我单击一个按钮时,我正在尝试执行此操作,此按钮将数组的值从控制器传递到视图。但是如何使用 javascript 调用控制器操作并传递数组?
这是我在控制器中的操作方法:
public ActionResult Index()
{
TahakkukServicesClient client = new TahakkukServicesClient();
client.ClientCredentials.UserName.UserName = "service_test";
client.ClientCredentials.UserName.Password = "..";
client.ClientCredentials.ServiceCertificate.Authentication.CertificateValidationMode = System.ServiceModel.Security.X509CertificateValidationMode.None;
MakbuzList[] liste = client.GetMakbuzListe(2);
return View(liste);
}
而我的观点:
@model IEnumerable<MakbuzList>
@using icerik.TahakkukServices
@{
ViewBag.Title = "E-Belediye";
Layout = "~/Views/Shared/Ecouncil.cshtml";
}
<script type="text/javascript">
????????????
</script>
<li><a class="collapsed">Description</a>
<ul>
<li><a href="#">Button1</a></li>
</ul>
</li>