// The "Return key" can only be used to return to the previous page. Only when the keyboard, context menu, or pop-up window is available, the return operation is to close the keyboard, cancel the context menu, or pop-up window. // If there is a pop-up window on the page, press "Return key" to cancel the pop-up window instead of returning to the previous page. The page class provides the onbackkeyprocess method that can be reloaded for processing this logic: protected override void onbackkeypress (system. componentmodel. canceleventargs e) {If (Popup. isopen) {Popup. isopen = false; E. cancel = true;} base. onbackkeypress (e) ;}// in some cases, you need to remind the user whether to exit the current page (back to the previous page), for example, to remind the user to save the current page. The onbackkeyprocess method can be reloaded as follows: protected override void onbackkeypress (system. componentmodel. canceleventargs e) {If (_ isnewlist) {If (! Popupsavepromotion. isopen) // promotion not opened yet, show it {e. cancel = true; popupsavepromotion. isopen = true;} else if (popupsavepromotion. isopen) // promotion already showed, if back key hit again, then close promotion and allow back key process continue {popupsavepromotion. isopen = false;} base. onbackkeypress (E );}