At the general election of 1880 Asher was unsuccessful as Liberal candidate for the universities of Glasgow and Aberdeen. In 1881, following the resignation of M. E. Grant Duff from the Elgin Burghs constituency, Asher was chosen to represent the Liberal Party at the 1881 Elgin Burghs by-election. He was elected unopposed on 13 July. He immediately took office in the Liberal Government of William Gladstone as Solicitor General for Scotland, serving until 1885. He was elected unopposed at the General Election 1885, at a by-election on 12 February 1886 after re-acceptance of office as Solicitor General for Scotland and again at the General Election 1886. His second spell as Solicitor General being cut short when the Liberals lost power. He stood again at the 1892 United Kingdom general election, and was re-elected, this time opposed, by a majority of 541. After that election the Liberals were returned to power. Asher took office in that government, again as Solicitor General for Scotland, serving for another two years.