如何使用Razor在MVC5中实现按钮(Devexpress控件)的客户端事件。
我尝试了这个,但点击事件没有解雇
<script type="text/javascript">
function OnClick(sender, args)
{
alert("Click");
}
</script>
@Html.DevExpress().Button(settings =>
{
settings.Name = "Button";
settings.Text = "Submit";
settings.ClientSideEvents.Click = "function(sender,args){ alert('Click'); }";
}).GetHtml()
答案 0 :(得分:0)
您需要设置Message Enqueued
并替换settings.EnableClientSideAPI = true;
与settings.ClientSideEvents.Click = "function(sender,args){ alert('Click'); }";