我知道这个问题已经被问过很多次了。我经历了所有的解决方案,但没有任何帮助。因此,我发布一个问题作为最后的手段!我正在使用弹出扩展器来输入电子邮件地址。控件中有两个按钮,一个用于提交电子邮件地址,另一个用于取消操作并隐藏弹出窗口。发送按钮单击事件似乎根本没有触发!下面附上我的代码。弹出窗口位于母版页(Home.Master)设计中。我在使用 home.master 作为其母版页的 login.aspx 页面中调用它。
<div>
<asp:ModalPopupExtender ID="idPopupExtend" runat="server" TargetControlID="lblPopupMsg"
PopupControlID="popUpPanel"
BackgroundCssClass="modalBackground"
DropShadow="true">
</asp:ModalPopupExtender>
<asp:Panel Width="338px" ID="popUpPanel" runat="server" CssClass="widget">
<div id="loginform">
<table>
<tr>
<td colspan="2">
<asp:Label ID="lblPopupMsg" runat="server" Text="" class="control-label"></asp:Label>
</td>
</tr>
<tr>
<td><span class="txt">Email Address <span class="redstar">*</span> : </span></td>
<td>
<asp:TextBox ID="txtEmail" runat="server" placeholder=" Email Address" CssClass="span4" Width="190px" Height="29px"></asp:TextBox>
<br />
</td>
</tr>
<tr style="height: 8px">
<td></td>
</tr>
<tr>
<td></td>
<td>
<asp:Button ID="btnSend" runat="server" Text="Send" class="btn btn-sm btn-info" />
<asp:Button ID="btnCancel" runat="server" Text="Cancel" class="btn btn-sm" />
</td>
</tr>
</table>
</div>
</asp:Panel>
</div>
调用显示弹出窗口的登录页面代码:
Panel pnlpopup;
Table Tbl = new Table();
Button btncancel = new Button();
Label lbMessage = new Label();
Label lbMessageConfirm = new Label();
ModalPopupExtender popupExtend = new ModalPopupExtender();
Button btnSend = new Button();
protected void lnkForgotPassword_Click(object sender, EventArgs e)
{
Control ctrlForm = new Control();
ctrlForm = Master.FindControl("form1");
pnlpopup = new Panel();
pnlpopup = (Panel)ctrlForm.FindControl("popUpPanel");
pnlpopup.Visible = true;
popupExtend = (ModalPopupExtender)ctrlForm.FindControl("idPopupExtend");
btnSend = (Button)ctrlForm.FindControl("btnSend");
popupExtend.Show();
}
btnsend 事件根本没有触发。事件的初始化已在页面加载事件中完成。请帮忙!谢谢