如何解决如何在服务器端禁用按钮提交几秒钟
我在几秒钟内为禁用按钮创建了客户端,但我需要在服务器端,我在客户端执行此操作,但这对我来说效果不佳。这是我尝试执行的代码。在这个网络应用程序上,有 5 名员工,我想在他们第一次点击时禁用按钮 3 秒,在我的解决方案中,我遇到了一个问题,当他们中的两个人同时点击时,它会生成相同的 idCode。
local humanoid=hit.Parent:FindFirstChild("Humanoid")
if not humanoid then
humanoid = hit.Parent.Parent:FindFirstChild("Humanoid")
end
在 @using (Html.BeginForm("GenerateCodes","Codes",FormMethod.Post))
{
<div class="Box-header">
<div class="row">
<div class="col-md-3 text-right">
<!--disable button for about 3 second after click button-->
<button type="submit" id="ok" class="btn btn-primary btn-lg" onclick="return displayProgressMessage(this,'Saving...');">Generate</button>
<script>
function displayProgressMessage(ctl,msg) {
$(ctl).prop("disabled",true);
$(ctl).text(msg);
return true;
}
</script>
</div>
</div>
</div>
}
中,我使用 Html.BeginForm
作为我的控制器,并且我已经在该控制器中定义了 GenerateCodes
Codes.cs
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。