How to get the route value from the URL?

e.g. URL = http://127.0.0.1/OrdersView/21?showdetail=

// Page Render event
function Page_Render()
{
    //Log("Page Render");

$myRows = ExecuteRows("SELECT * FROM order_details WHERE _order_fk_id = " . URL_ID);
}

New to MVC, how do I get the 21 from the URL and assign URL_ID = 21 in SQL query?

You may try How to Get Route Values from URL (v2021).