Taskin's hat-trick restricted Sri Lanka at 311 for all wickets during the second ODI of the 3-match series against Bangladesh at Rangiri Dambulla International Stadium Tuesday.
Taskin becomes fifth Bangladesh player to pick up a hat-trick in ODI cricket.
Upul Tharanga, playing his 200th ODI, set it up for the hosts with a fine fifty. Mendis, meanwhile, overcame a scratchy start and sprinted to his maiden ODI hundred. Asela's sparkling cameo then took the side past 300.
Before getting out of captain Tharanga, Mendis made a century stand with him and the second wicket partnership between them added 111 runs in the score board.
The partnership between captain Tharanga and Kusal Mendis broke in a direct hit of Mahmudullah.
No side has successfully chased a target of over 300 in Sri Lanka.
Earlier, Bangladesh got their first breakthrough in the third over when Mashrafe Mortaza dismissed Sri Lanka opener Danushka Gunathilaka to leave the hosts at 18 for 1.
Sri Lanka have elected to bat after winning the toss in their must-win clash against Bangladesh in the second ODI in Dambulla.
With their first series win against the islanders on cards, Bangladesh fielded the same side on Tuesday that steered them to a 1-0 lead in the series with a crushing win in the opener at Rangiri Dambulla International Stadium.
Sri Lanka made three changes to the line-up. Pacers Nuwan Kulasekara and Nuwan Pradeep returned to the fold while Dilruwan Perera also got in. Sachith Pathirana, Lahiru Kumara, and Lakshan Sandakan were dropped.
Bangladesh: Tamim Iqbal, Soumya Sarkar, Sabbir Rahman, Mushfiqur Rahim (wk), Shakib Al Hasan, Mahmudullah, Mosaddek Hossain, Mehedi Hasan Miraz, Mashrafe Mortaza (cpt), Taskin Ahmed, Mustafizur Rahman.
Sri Lanka: Danushka Gunathilaka, Upul Tharanga (cpt), Kusal Mendis, Dinesh Chandimal (wk), Asela Gunaratne, Milinda Siriwardana, Thisara Perera, Dilruwan Perara, Suranga Lakmal, Nuwan Kulasekara, Nuwan Pradeep.