Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8373317
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T14:38:55+00:00 2026-06-09T14:38:55+00:00

C#, ASP.NET, JS I have this pop up opened where employees work on different

  • 0

C#, ASP.NET, JS

I have this pop up opened where employees work on different clients.
Once they are done they click on a button and a few proceses run before actually closing the pop up window.

What I want to achieve is the same thing when they hit the X top right button of the screen.

I’ve tried this:

.aspx.

window.onclose = closePage;

.js.

function closePage() { 
__doPostBack('XXXX', '');
}

.cs

//In Page_Load
if (Request["__EVENTTARGET"] == "XXXX")
       {
           //desired code.
       }

It’s definetely not firing.

Any suggestions?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T14:38:56+00:00Added an answer on June 9, 2026 at 2:38 pm

    ASP.net runs at server level and doesn’t inherently “know” when the site is closed by the user. To achieve what you want you need to use ASP.NET Ajax.

    There is a good article here;

    http://stephenwalther.com/archive/2008/03/07/asp-net-ajax-in-depth-application-events.aspx

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

If I have this asp.net button: <asp:Button ID=Button_Save Width=150px OnClick=Button_Save_Click runat=server Text=Save /> In
I have this serious: I have ASP.NET page, This page contents Update panel with
I have a web service in asp.net and I have this model to return:
In code-behind of an ASP.NET page I have this method: public string TestFunc() {
So I have this asp.net web application that I renamed. I changed the assembly
So I have this ASP.Net 2.0 website that uses functions contained within a JS
I have this ASP.NET/SQLServer2005 website running on a production server (Win2003, QuadCore, 4GB). The
ASP.Net MVC3 is cool and all but I have this question more out of
I have this website (C#/ASP.NET) with a form where the user can register for
I have this problem in my ASP.NET application where I'm seeing some of my

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.