Differentiating a normal window from a popup window.

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi all,

Is there any way from which we can find out if a window is opened as a modal
window or as a normal window?

I have a screen which opens as a normal window in one case and in other case
it opens as a modal window.
I want to differentiate these two conditions.

TIA.
 
On the client, you can use JavaScript to check the "opener" property of the
window. A window spawned by another window has an "opener" that is a window.
If it was not spawned by another window, the 'Opener" will be null.

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
Neither a follower nor a lender be.
 
Try using window dialogArguments property. It applies only to windows
created by showModalDialog and showModelessDialog methods. When you open the
page in a modal window, pass something in this parameter. Otherwise leave it
null.

Wouldn't be surprised to see better solutions.

Eliyahu
 
I always get it as "Undefined" :(

Kevin Spencer said:
On the client, you can use JavaScript to check the "opener" property of the
window. A window spawned by another window has an "opener" that is a window.
If it was not spawned by another window, the 'Opener" will be null.

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
Neither a follower nor a lender be.
 
Back
Top