ModalPopupExtender - 单击OK在AJAX中不起作用 [英] ModalPopupExtender - Click on OK does not work property in AJAX
问题描述
你好,
我试图更新数据库中的表,并通过ajax消息框向用户显示有关操作是否已完成的消息。请找到附件。
当我点击OK它没有执行任何aciton。
谢谢你支付
代码:(以下示例代码只包含一个ajax控件使用在主代码中我使用了更多。)
Hello,
I trying to update table in database and message is show to the user by ajax message box about operation finished or not. please find the attachment.
when I clicked on OK it is not performing any aciton.
thank you
Code:(following sample code contain only one ajax control used In main code I used much more. )
<asp:Panel ID="Message_Panel" runat="server" CssClass="modalPopup" align="center" Style="display: none; font-family: Times New Roman;">
<div class="popup_Container" style="background-color: white; border-radius: 5px; border: 5px solid purple;">
<div class="popup_Titlebar" id="Div6">
<div class="TitlebarLeft">
<asp:Label ID="LabelPopupHeader" runat="server"></asp:Label></div>
<div class="TitlebarRight" onclick="$get('Button_OK').Click();"></div>
</div>
<div class="popup_Body">
<table>
<tr>
<td>
<asp:Image ID="Image5" runat="server" Height="60px" Width="60px" /></td>
<td>
<asp:Label ID="LabelPopupContent" runat="server"></asp:Label>
</td>
</tr>
</table>
</div>
<div class="popup_Buttons">
<asp:Button ID="Button95" runat="server" Text="OK" />
<input type="button" id="Button_OK" value="OK" style="visibility: hidden;" />
</div>
</div>
</asp:Panel>
<asp:Label ID="dummyLabelMessage" runat="server" Style="display: none"></asp:Label>
<AjaxControlToolkit:ModalPopupExtender BackgroundCssClass="modalBackground" ID="Message_ModalPopupExtender"
runat="server" TargetControlID="dummyLabelMessage" PopupControlID="Message_Panel">
</AjaxControlToolkit:ModalPopupExtender>
.cs代码:
LabelPopupHeader.Text =消息;
LabelPopupContent.Text =设备名称已存在于选定的分支中!!!!! \ n,请输入其他设备名称...!;
Image5.ImageUrl =〜/ images / ALERT_Warning.jpg;
Message_ModalPopupExtender。 Show();
goto End;
.cs Code:
LabelPopupHeader.Text = "Message";
LabelPopupContent.Text = "Device Name already exists in selected Branch!!!!! \n\nPlease, Enter some other Device Name...!";
Image5.ImageUrl = "~/images/ALERT_Warning.jpg";
Message_ModalPopupExtender.Show();
goto End;
推荐答案
get('Button_OK')。点击(); > < / div >
< / div >
< div class = popup_Body >
< 表格 >
< tr >
< td >
< asp:Image ID = Image5 runat = server 高度 = 60px 宽度 = 60px / > < / td >
< td >
< asp:标签 ID = LabelPopupContent runat = 服务器 > < / asp:标签 >
< / td >
< span class =code-keyword>< / tr >
< / table >
< / div >
< div class = popup_Buttons >
< asp:按钮 ID = Button95 runat = server < span class =code-attribute> 文本 = 确定 / > ;
< 输入 type = 按钮 < span class =code-attribute> id = Button_OK value = 确定 样式 = visibility:hidden; / >
< / div >
< / div >
< / asp:Panel >
get('Button_OK').Click();"></div> </div> <div class="popup_Body"> <table> <tr> <td> <asp:Image ID="Image5" runat="server" Height="60px" Width="60px" /></td> <td> <asp:Label ID="LabelPopupContent" runat="server"></asp:Label> </td> </tr> </table> </div> <div class="popup_Buttons"> <asp:Button ID="Button95" runat="server" Text="OK" /> <input type="button" id="Button_OK" value="OK" style="visibility: hidden;" /> </div> </div> </asp:Panel>
<asp:Label ID="dummyLabelMessage" runat="server" Style="display: none"></asp:Label>
<AjaxControlToolkit:ModalPopupExtender BackgroundCssClass="modalBackground" ID="Message_ModalPopupExtender"
runat="server" TargetControlID="dummyLabelMessage" PopupControlID="Message_Panel">
</AjaxControlToolkit:ModalPopupExtender>
.cs代码:
LabelPopupHeader.Text =消息;
LabelPopupContent .Text =设备名称已经存在于选定的分支中!!!!! \ n,请输入其他设备名称...!;
Image5.ImageUrl =〜/ images / ALERT_Warning.jpg;
Message_ModalPopupExtender。 Show();
goto End;
.cs Code:
LabelPopupHeader.Text = "Message";
LabelPopupContent.Text = "Device Name already exists in selected Branch!!!!! \n\nPlease, Enter some other Device Name...!";
Image5.ImageUrl = "~/images/ALERT_Warning.jpg";
Message_ModalPopupExtender.Show();
goto End;
你的 dummyLabelMessage
first
插入标签并命名ID为dummyLabelMessage
你的 Message_Panel
创建一个面板和ID作为Message_Panel
在该面板上插入id为dummyLabelMessage的标签
你在Modalpopup标签中缺少CancelControlId ..
你也创建按钮并给出id.what u give在模态弹出窗口中..
你在模态弹出标签中写的东西创造了许多东西
添加ajax参考
Where is your dummyLabelMessage
first
insert a label and named ID as dummyLabelMessage
Where is your Message_Panel
Create a panel and ID as Message_Panel
on that panel insert the label which id as dummyLabelMessage
Your Missing CancelControlId in the Modalpopup tag..
U also create the button and give the id.what u give in the modal popup..
the things u write in the modal popup tag create althose things
Add the ajax reference
这篇关于ModalPopupExtender - 单击OK在AJAX中不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!