Question

I have done a sticky note application in asp.net. I have a parent window with a button, When I click on the button the sticky notes is opened as popup. I am using javascript window.open to open the popup. But I can run only one instance at a time. How I can I run multiple instances of the window in my application?

Was it helpful?

Solution

I got the answer.

In

window.open(strUrl, strWindowName [, strWindowFeatures]);

use strWindowName as '_blank'. For Example

function ShowStickyNotes(sender, args)
{
    var width = 205;
    var height = 170;
    var left = (screen.width - width) / 2;
    var top = (screen.height - height) / 2;
    var params = 'width=' + width + ', height=' + height;
    params += ', top=' + top + ', left=' + left;
    params += ', directories=no';
    params += ', location=no';
    params += ', menubar=no';
    params += ', resizable=no';
    params += ', scrollbars=no';
    params += ', status=no';
    params += ', toolbar=no';
    window.open("Notes.aspx?", "_blank", params);
}

OTHER TIPS

You need to give each of your popup windows a different name, so try changing the strWindowName parameter for each popup:

window.open(strUrl, strWindowName [, strWindowFeatures]);
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top