Can I close a browser in ASP.Net 2.0 without resorting to any javascript?

Posted on 2006-04-06
Last Modified: 2010-04-07
I'm using Visual Web Developer Express.
I'm a competent VB6, ADO, ADO.Net & SQL programmer with a healthy dose of HTML, CSS and XML, but finding VB.Net a bit slow to get into.
I'm developing a web app for a customer. I have a pop up window which I want to close if the user presses the cancel button.

I know I can do this using the html/javascript solution of onclick="window.close".

But, as I'm trying to avoid learning yet another language, I'm sure there must be a pure VB.Net way of doing this!

Question by:chrismc
    LVL 35

    Accepted Solution

    No there is not.

    .NET is a server side language.  It runs on the server.  You are trying to close a browser, which is part of the client machine.  You have to do that on the client.  Hence you have to use javascript or another client program (i.e. active X).

    If you are designeing a web app you should be embracing learning javascript not avoiding it.  Otherwise your apps will always be amatuer and very basic.
    LVL 18

    Author Comment


    I have now come to that conclusion too.

    I wasn't supposed to be doing any of the web coding anyway - but hey, I'm getting paid for it!

    LVL 35

    Expert Comment

    Always a good thing to expand your skill set to get paid more :o)

    Featured Post

    How your wiki can always stay up-to-date

    Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
    - Increase transparency
    - Onboard new hires faster
    - Access from mobile/offline

    Join & Write a Comment

    In this short web based tutorial, I wanted to show users how they can still use the powers of FrontPage in conjunction with Expression Web 3.  Even though Microsoft eliminated the use of Web components, we can still use them with FrontPage and edit …
    This article provides a case study on how our local youth baseball league deployed a new website, including the platform selection, implementation and benefits to the league.
    The purpose of this video is to demonstrate how to automatically show related posts at the bottom of a blog post in WordPress. This will be demonstrated using a Windows 8 PC. Plugin “Yet Another Related Posts Plugin” will be used. Go to your…
    The purpose of this video is to demonstrate how to exclude a particular blog category from the main blog page. This is can be used when a category already has its own tab, or you simply want certain types of posts not to show up on the main blog. …

    746 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    17 Experts available now in Live!

    Get 1:1 Help Now