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

  • SEARCH
  • Home
  • 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 8348519
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T07:42:49+00:00 2026-06-09T07:42:49+00:00

In my application I am using a popup in a page. When I press

  • 0

In my application I am using a popup in a page. When I press on back key, I need to close the popup if it is open and stay on the page. When I pressed on the back key, the popup not closed and the page goes to previous one. To close the popup now I use the following code in the back key press event.

protected override void OnBackKeyPress(System.ComponentModel.CancelEventArgs e)
{
    if (myPopup.IsOpen)
        myPopup.IsOpen = false;

    else if (NavigationService.CanGoBack)
        NavigationService.GoBack();
}

When using this code, the popup will close but also goes to the previous page. I need to go back only if popup is in closed state. How can I do this?

  • 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-09T07:42:51+00:00Added an answer on June 9, 2026 at 7:42 am

    Problem Solved.

    Instead of using

    protected override void OnBackKeyPress(System.ComponentModel.CancelEventArgs e)
    {
    }
    

    I used the back key press event of the page

    private void PhoneApplicationPage_BackKeyPress(object sender, System.ComponentModel.CancelEventArgs e)
    {
        if (myPopup.IsOpen)
            myPopup.IsOpen = false;
    
        else if (NavigationService.CanGoBack)
            NavigationService.GoBack();
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an application that open's some dynamic popup either using window.open() or using
I am developing web application. In that i want to open one popup using
I am using jquery modal popup in my application with MVC3 Razor view. Issue
I am popping up an HTML page from a Silverlight application using the HtmlPage.PopupWindow()
Am using master page in my asp.net application, and I want to reset the
I'm using wordpress to create a 'download' popup that goes to a file attachment
In codeigniter application i pop up a window from a view page using href
I am thinking about opening the help page of my application in a popup
what I need: upload photos to user's fan page as a page, using an
I'm developing an application using Mozilla Prism. Unfortunately, Prism has its pop-up blocker activated.

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.