Hi Kevin,
Thanks for the tips, I had never imagined that, I think this is something
MS needs to change, it allow a rogue page to close my browser without a
warning.
I had always thought it was not possible
Thank again,
--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation
"Kevin Spencer" <> wrote in message
news:...
> > No, there is no way of doing this. The only windows you can close with
> any
> > notification are the windows that your browser create.
>
> Not true! The window.close() method checks to see if the opener property
of
> the window is null (meaning that it was not spawned by another browser
> window). If you set the opener property to the window itself, it closes
> without a prompt:
>
> window.opener = self;
> window.close();
>
> Try it!
>
> --
> HTH,
> Kevin Spencer
> .Net Developer
> Microsoft MVP
> Big things are made up
> of lots of little things.
>
> "Ignacio Machin ( .NET/ C# MVP )" <ignacio.machin AT dot.state.fl.us>
wrote
> in message news:...
> > HI Ron,
> >
> > No, there is no way of doing this. The only windows you can close with
> any
> > notification are the windows that your browser create.
> >
> > Cheers,
> >
> > --
> > Ignacio Machin,
> > ignacio.machin AT dot.state.fl.us
> > Florida Department Of Transportation
> >
> > "Ron Lautmann" <> wrote in message
> > news:...
> > > I want to close a browser window so I created a Close button that does
> > this:
> > >
> > > private void Button1_Click(object sender, System.EventArgs e)
> > > {
> > > RegisterClientScriptBlock("GetData","<Script>close ()</Script>");
> > > }
> > >
> > > But when this runs the browser puts up a dialog box saying: "The web
> page
> > > you are viewing is trying to close the window, od you want to close
this
> > > window?"
> > >
> > > Is there a way to close a browser window without this dialog box?
> > >
> > >
> >
> >
>
>
|