开发者

Modal popup is not run in IE browser

I wrote a modal popup. I use ajax modal popup extender but It is not run in IE. Why?

<script type="text/javascript">
            //<![CDATA[
            var _eventButtonElement = null;

            function OkClick() {
                if (_eventButtonElement) {
                    _eventButtonElement.click();
                }
            }

            function CancelClick() {
                _eventButtonElement = null;
                return true;
            }

            function showModalPopupViaClient(Icon, Title, Message) {
                if (_eventButtonElement) {
                    return CancelClick();
                }

                _eventButtonElement = window.event.srcElement;

                var modalPopupBehaviorVar = $find('programmaticModalPopupBehavior');
                var modalPopupTitleVar = $get('modalPopupTitle');
                var modalPopupIconVar = $get('modalPopupIcon');
                var modalPopupMessageVar = $get('modalPopupMessage');
                var CancelButtonContainerVar =开发者_Python百科 $get('CancelContainer');

                if (Icon == 'Information') {
                    modalPopupIconVar.src = 'App_Images/Test/Information.png';
                    CancelButtonContainerVar.style.display = 'none';
                } else if (Icon == 'Explanation') {
                    modalPopupIconVar.src = 'App_Images/Test/Exclamation.png';
                    CancelButtonContainerVar.style.display = 'none';
                } else if (Icon == 'Error') {
                    modalPopupIconVar.src = 'App_Images/Test/Error.png';
                    CancelButtonContainerVar.style.display = 'none';
                } else if (Icon == 'Question') {
                    modalPopupIconVar.src = 'App_Images/Test/Question.png';
                    CancelButtonContainerVar.style.display = '';
                }

                modalPopupTitleVar.innerHTML = Title;
                modalPopupMessageVar.innerHTML = Message;
                modalPopupBehaviorVar.show();

                return false;
            }


            //]]>
        </script>

        <asp:Panel runat="server" ID="programmaticPopup" style="width:350px;padding:10px" CssClass="modalPopup">
            <asp:Panel runat="Server" ID="programmaticPopupDragHandle" Style="cursor: move;background-color:#ddd;border:solid 1px gray;color:#000;text-align:left;padding-left:5px">
                <img id="modalPopupIcon" alt="" src="" class="" />&nbsp;&nbsp;<span id="modalPopupTitle" />
            </asp:Panel>

            <p class="smalltext" id="modalPopupMessage" />

            <div style="text-align:center">
                <span class="button" >
                    <asp:Button ID="OkButton" CausesValidation="false" OnClientClick="return false;" runat="server" Text="Ok" />
                </span>
                <span class="button" id="CancelContainer">
                    <asp:Button ID="CancelButton" CausesValidation="false" OnClientClick="return false;" runat="server" Text="Cancel" />
                </span>
            </div>
         </asp:Panel>
        <asp:ModalPopupExtender runat="server" ID="programmaticModalPopup"
                BehaviorID="programmaticModalPopupBehavior"
                TargetControlID="hiddenTargetControlForModalPopup"
                PopupControlID="programmaticPopup"
                OkControlID="OkButton"
                OnOkScript="OkClick();"
                OnCancelScript="CancelClick();"
                CancelControlID="CancelButton"
                BackgroundCssClass="modalBackground"
                DropShadow="True" 
                PopupDragHandleControlID="programmaticPopupDragHandle"
                RepositionMode="RepositionOnWindowResizeAndScroll"/>
        <asp:Button runat="server" CausesValidation="false" ID="hiddenTargetControlForModalPopup" style="display:none"/>

        <asp:Button ID="Button1" CausesValidation="false" runat="server" OnClientClick="return showModalPopupViaClient('Question','Question','Are you sure...?');" Text="Submit" />
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜