Referencing parent window from an iframe on a modal popup - asp.net

I am using the AJAX modalpopupextender and I have an iframe embedded in the modal popup. I need to be able to reference the parent window (the window from which the modal popup was launched) to reload/change the URL when certain events on the modal popup are fired. I have tried window. top, window.parent, opener, root, etc., and have had no success. Any help would be appreciated.

Something along the lines of:
self.parent.opener
I've created a modal popup a bit like that in the past, and that selector enabled me to start mucking around with the DOM on the page that opened the window.
See more here or here

Related

How to remove unknown property created during opening of a mat-select modal

I am facing problem on removing unknown division created during opening of a mat-select.
When I am opening a modal and after selecting values ,I need to click directly on the button given on side but because of some property of modal a div is getting created and I have to do two clicks on the button to apply changes.
Right now when I am clicking outside the mat-select modal to make it close then clicking on button it is going correct. But I need to open modal -> select options -> direct click on the button given.
Something in the background is blocking the first click when opening a mat-select modal. I am not able to see what is that. Is there some css property that can be block ? I am not getting exact hidden problem.
Modals in Angular Material create something that's called 'backdrop' by default. This backdrop is like a layer right behind your modal, filling the whole page. If you click somewhere on the page, your target will be the backdrop, which then closes the modal.
So for you to achieve, what you want to achieve, you have the following options:
edit the backdrop behavior to not prevent the default click action, so that clicks on the backdrop close the modal but also trigger the action you want
remove the backdrop on opening of the modal (this can be done by setting a flag hasBackdrop in the open methods config parameters) and close the modal programmatically by triggering the close method of the MatDialogRef
This is standard modal behavior, you should include all your needed options either before opening a modal or in the modal itself after being opened.

Without reloading bring to view page

Click from parent window open a child window using window.open("url","name").If again clicked the parent for opening the child window then check if the child window is already opened.if it is already opened then bring to view that page without reloading otherwise open in new window.
If you want to open the popup window using window.open() itself then check this thread
Check if a popup window is already open before opening it using Jquery
There is a better alternative to do this by using Jquery Dialog:
Just put a div in the parent window which will act as the container for the popup contents and check whether it is visible or not.

Pinterest: How to make the content within iframe fancybox window pinable?

On my website, I have a list of users. By clicking each one, a fancybox pop up window will show. Within the window, I use iframe to load a page with paintings from the user.
Is there any way to make the images in fancybox iframe pinable by clicking pinterest bookmark pin it button? Or do I have to add a pin it button to each HTML page?
Thanks,
Milo
The bookmarklet button works on the page that is currently loaded. Usually, if an iframe has changed even slightly from its original url, it is inaccessible to the parent page via javascript. The actual iframe itself has to initiate the appropriate messaging request systems.
If you can have the iframe send a message to the parent window that contains the desired images and then have the parent window add the image links to the page, that seems to be the only way to do it right now. Look into the postMessage() function.
As you asked if there is "any way" to do it, I would say yes. However, it is very ugly. Probably better to add pinit buttons to each image in the iframe. :)

how to disable parent window in asp.net using javascript

i hv an asp.net form in which i have used master page, in this by clicking on one link button a popup window will be opened, my problem is i want to close a popup child window when parent form is closed.. or i should make parent form disable when child popup is active...
i got some code but its working only for IE,, please help me to work this in Google chrome
this is my code which is working For IE
in parent window i wrote like this
function topWindow() {
var popup = window.open('BranchSearch.aspx', 'mywindow', 'location=1,width=450,height=100,toolbar=0,menubar=no,resizable=no,scrollbars=no,status=no,left=340,top=340');
popup.focus();
}
and in body tag of child pop window i wrote like dis
please help me as soon as possible
thank u
You can use window.showModalDialog This will disable parent window until you close the child window.

Javascript Popup window in IE6 and above

I'm opening a modal dialog for IE6 and above using the following javascript.
window.showModalDialog(
'SelectUser.aspx',
null,
'status:no;dialogWidth:500px;dialogHeight:220px;dialogHide:true;help:no;
scroll:yes;toolbar:no;title:no;resizable:yes;location:no;menubar:no;'
);
In the popup dialog box a grid is shown from which user can select... Grid has paging applied to it however when the pager link for next, previous, first, last or any page number is clicked page index changed is fired and page is posted back and the page result is shown in a new IE window. How to fix this.
Show your page (SelectUser.aspx) in iframe in the popup window.
The modal dialog box if contains a form and when post back will open up in a new window. However there is a workaround to this and that is to Add <base target="_self"/> inside of the <head> tags in the .aspx file of the ModalDialog window.

Resources