在我的文件后面的代码中,我调用了一个 html 模式弹出窗口,它提示用户输入他们的用户名和密码。在继续之前,我想从这个返回到我调用函数后面的代码。我该怎么做呢?现在显示了模态表单,并且 c# 代码继续处理这是有道理的,但它不是我想要的。注意: modal signoff html modal form 有一个按钮(btnSignoff),它调用一些其他代码隐藏函数感谢Damo
后面的代码:
SignoffModal.Show();
//Wait for response (this is what i would like to be able to do)
if (result <0)
{
//throw some error
}
else
{
// Do some more work
}
HTML 代码:
<!-- Signoff Modal Form -->
<asp:HiddenField ID="SignoffForModal" runat="server" />
<ajaxToolkit:ModalPopupExtender runat="server" ID="SignoffModal" BehaviorID="modalPopupExtenderSignoff"
TargetControlID="SignoffForModal" PopupControlID="popUpPaneSignoff" OkControlID="btnSignoff"
BackgroundCssClass="modalBackground">
</ajaxToolkit:ModalPopupExtender>
<asp:Panel ID="popUpPaneSignoff" runat="server" CssClass="confirm-dialog">
<asp:Label ID="lblUsername" runat="server" Text="Username"></asp:Label>
<br />
<asp:TextBox ID="txtUserName" runat="server" ToolTip="Username" Width="200px"></asp:TextBox>
<br />
<asp:Label ID="lblPassword" runat="server" Text="Password"></asp:Label>
<br />
<asp:TextBox ID="txtPassword" runat="server" ToolTip="Password" TextMode="Password"
Width="200px"></asp:TextBox>
<br />
<br />
<div class="base">
<asp:Button ID="btnSignoff" runat="server" Text="Signoff" />
<asp:LinkButton ID="LinkButton3" runat="server" CssClass="close" OnClientClick="$find('modalPopupExtenderSignoff').hide(); return false;" /></div>
</asp:Panel>
<!-- End Signoff Modal Form -->