Wednesday, March 28, 2012

Modal Popup events?

Okay I call a modal popup in my page and then reposition the popup to appear over the elemnt clicked using the $get, getlocation and setLocation in the AJAX library - however inside my modal popup I have an update panel that updates the contents based on selecting a link button in the popup - when the popup returns the new content it automatically recenters itself like it reinitalizes

My question is is there a event or method that I cna use to repostion my popup after this happens or is there a way to prevent it from doing this?

TIA

The update panel should be inside the modal popup not embedding it so that only that markup(the link button and the content) is refreshed and the entire modal popup is not re-rendered. Could you post a small code snippet that demonstrates what you are doing?

the update panel is inside the modal popup (it doesnt work otherwise i found) when the content in side that update panel is refresehed the modal popup is not rerendered (that i can see) but it moves to its centered position

my code to move the modal popup is this javascript

1<script>2function pageLoad()3{4 var popup = $find('dnn_LOGIN1_ModalPopupExtender');5popup.add_shown(SetFocus);6}7function SetFocus()8{9var login_button = $get('dnn_LOGIN1_hypLogin');10var loginscreen = $get('dnn_LOGIN1_Panel1');11var position = Sys.UI.DomElement.getLocation(login_button);12Sys.UI.DomElement.setLocation(loginscreen,position.x-170,position.y+12);13$get('dnn_LOGIN1_txtUsername').focus();14}15</script>

(is that enough?)

TIA

No comments:

Post a Comment