ModalPopupExtender and z-index

How can I change the z-index ASP.NETAJAX ModalPopupExtender. The default is 100001. Thanks.

+2
source share
3 answers

I am using this function:

function ShowModalPopup(modalPopupId, zIndex) { try { if (modalPopupId == null) throw new Error(0, 'Incorrect value of param modalPopupId!'); var modalPopupBehavior = $find(modalPopupId); if (modalPopupBehavior == null) throw new Error(0, 'Not found modal popup ' + modalPopupId + '!'); zIndex = typeof (zIndex) != 'undefined' ? zIndex : null; if (zIndex != null) { modalPopupBehavior._backgroundElement.style.zIndex = zIndex; modalPopupBehavior._foregroundElement.style.zIndex = zIndex + 1; } modalPopupBehavior.show(); } catch (ex) { alert('Exception in ShowModalPopup: ' + ex.message); } } 

and its call:

  ShowModalPopup('<%= modalpopup.ClientID %>', 20001); 
+3
source

I am assigning a CSS class to the panel to which my modalpopupextender is assigned (PopupControlID) and puts somthing like:

 .ModalSelect { z-index:70000 !important; /*other css*/ } 
+5
source

You can attach a handler to the event shown in modalpopup, which allows you to install zIndex:

 function pageLoad() { var popup = $find('ModalPopupClientID'); popup.add_shown(SetzIndex); } function SetzIndex(sender,args) { sender._container.style.zIndex=9990001; } 
0
source

Source: https://habr.com/ru/post/1390194/


All Articles