我有以下 div (通常隐藏)
<div id="confirmDialog" class="window" style="background-color:#f2f4f7; border:1px solid #d9a0e2; text-align:center; height:100px; position:fixed; padding:10px; top:50% " runat="server" visible="false">
<br /> You already have a leave request on the chosen date. Are you sure you want to submit this request?<br /><br />
<asp:Button ID="BtnConfirm" runat="server" Text="Yes" Width="60px" />
<asp:Button ID="BtnNo" runat="server" Text="Cancel" onclick="BtnNo_Click" />
</div>
当用户单击提交时,代码开始执行,如果以下函数为真,我想在继续执行代码之前显示一个确认对话框:
protected void BtnAdd_Click(object sender, EventArgs e)
{
//some validations
if (new LeaveLogic().GetEmployeeLeaveRequestByDate(username, Convert.ToDateTime(TxtBoxDate.Text)) > 0)
{
confirmDialog.Visible = true;
/if BtnConfirm is click continue to execute code
//else stop
我怎样才能通过 asp.net/jQuery 做到这一点?