Click here to Skip to main content
15,867,594 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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.NET
<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.NET
<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 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;
Posted
Updated 23-Nov-15 17:04pm
v7

1 solution

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
 
Share this answer
 
v4
Comments
Kishor-KW 23-Nov-15 23:05pm    
Message_Panel and dummyLabelMessage is there,<asp:Label ID="dummyLabelMessage" runat="server" Style="display: none">

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month


CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900