Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   ASP .Net (http://www.velocityreviews.com/forums/f29-asp-net.html)
-   -   force close the aspx page. (http://www.velocityreviews.com/forums/t103994-force-close-the-aspx-page.html)

Eitan 06-04-2005 11:11 PM

force close the aspx page.
 
Hello,
How can I close the aspx by force (with some commands) ?

Thanks :)



Robbe Morris [C# MVP] 06-05-2005 12:48 AM

Re: force close the aspx page.
 
client side javascript

window.close();

Once the page has been delivered to the browser. The server
cannot send a command to it until the client sends another request.

So, you have to do this client side in some fashion.

--
2004 and 2005 Microsoft MVP C#
Robbe Morris
http://www.robbemorris.com
http://www.masterado.net



"Eitan" <nospam@nospam.com> wrote in message
news:uMJt8HVaFHA.464@TK2MSFTNGP15.phx.gbl...
> Hello,
> How can I close the aspx by force (with some commands) ?
>
> Thanks :)
>




Eitan M 06-05-2005 08:43 PM

Re: force close the aspx page.
 
What I did,
on page_load event, I added the code :

Dim btn As Button

btn = CType(btnOK, Button)

btn.Attributes.Add("onclick", _

String.Format("window.close();"))



Dialog truely close, thanks.

(so there are event onclick on the client, and onclick on the server).

One problem is that just after closing the dialog,

the contents of the dialog appear in a new window (In IE web browser),

Which I don't want that this will happen.



What may be wrong ?



Thanks :)



Eitan M 06-05-2005 09:02 PM

Re: force close the aspx page.
 

> What I did,
> on page_load event, I added the code :
>
> Dim btn As Button
>
> btn = CType(btnOK, Button)
>
> btn.Attributes.Add("onclick", _
>
> String.Format("window.close();"))
>
>
>
> Dialog truely close, thanks.
>
> (so there are event onclick on the client, and onclick on the server).
>
> One problem is that just after closing the dialog,
>
> the contents of the dialog appear in a new window (In IE web browser),
>
> Which I don't want that this will happen.
>
>
>
> What may be wrong ?


Also I don't want that on_load event occurs just after pressing the
server-side button.

Thanks :)




All times are GMT. The time now is 08:03 PM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.