-
How to close browser?
I have an ASP.NET with C# application and want to close browser window with
click of a button (or link). One can do this with
Response.Write("<script>window.close()</script>");
But this does NOT work if the smartnavigation property of the webform is
set to TRUE.
Does anyone know how to close a browser window in C# with ASP.NET? Please
do NOT suggest java scripting/cookie etc. There must be no cookies attached
and all code is server side. Yeah, it is bad idea but let it go that way
for now. Thanks in advance.
SD
-
Re: How to close browser?
"d_danturthi@hotmail.com" <vb.@127.0.0.1> wrote in message
news:3ece9f16$1@tnews.web.devx.com...
>
> I have an ASP.NET with C# application and want to close browser window
with
> click of a button (or link). One can do this with
>
> Response.Write("<script>window.close()</script>");
>
> But this does NOT work if the smartnavigation property of the webform is
> set to TRUE.
>
> Does anyone know how to close a browser window in C# with ASP.NET? Please
> do NOT suggest java scripting/cookie etc. There must be no cookies
attached
> and all code is server side. Yeah, it is bad idea but let it go that way
> for now. Thanks in advance.
It's not possible without client-side script (like your first try uses). How
can code that runs on your server tell a user's web browser what to do? All
your C#/ASP.NET code does is produce HTML, CSS, and JavaScript; IE doesn't
understand C#.
FYI - current versions of IE will ask for confirmation if you try to close
the browser window from script.
--
Dave Rothgery
drothgery@alum.wpi.edu
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
Forum Rules
|
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL
|
Bookmarks