Tuesday, 22 July 2014

Show alert Messages using AjaxPopupEx. in asp.net using jquery


//Modalpopup

<asp:ModalPopupExtender ID="ModalAlert" runat="server" TargetControlID="hdn_alertmodal" BehaviorID="ModalAlertB"
                PopupControlID="pnl_alert" CancelControlID="btn_cancelalert" BackgroundCssClass="modalBackground">

            </asp:ModalPopupExtender>

//Panel

<asp:HiddenField ID="hdn_alertmodal" runat="server" />
            <asp:Panel ID="pnl_alert" runat="server" Style="display: none;" class="modalPopup"
                Width="345px">
                <div style="padding: 0 0 10px 0;">
                    <div class="header">
                        Alert !</div>
                    <div style="width: 332px; text-align: center" class="body">
                        <div style="width: 100%; height: 8px;">
                        </div>
                        <asp:Label ID="lbl_messages" runat="server" CssClass="LabelHeader" Font-Bold="True"
                            Font-Size="11pt" Width="316px"></asp:Label>
                    </div>
                    <div style="text-align: center;">
                        <asp:Button ID="btn_cancelalert" runat="server" CssClass="myButton" Text="  OK  "
                            Width="74px" /></div>
                </div>
                <div class="footerCategory" align="right">
                </div>
            </asp:Panel>


////////////////Script

<script type="text/javascript">
$('#<%=lbl_messages.ClientID%>').html("To date must be grater than From Date"); 
$find('ModalAlertB').show();
return false;
                    
</script>

No comments:

Post a Comment

How to highlight selected text in notepad++

  –> To highlight a block of code in Notepad++, please do the following steps step-1  :- Select the required text. step-2  :- Right click...