You will only need a visa if you plan to visit Istanbul. If you are staying in the transit area, then you do not need a visa. From the Turkish Ministry of Foreign Affairs FAQ Page:
Question: I will be flying to Europe. I know that our aircraft will
land in İstanbul. I am not planning to leave the transit lounge. Do I
need to get transit visa?
Answer: If you will not leave the transit lounge at the airport you
are not required to have transit visa. Otherwise, you have to make
visa application to the nearest Turkish Representation. Contact
information of the said missions can be reached through www.mfa.gov.tr
However, if you want to visit Istanbul, then you will need a visa:
Bangladeshi nationals holding diplomatic and official/service passport
are exempted from visa for their travels up to 90 days. Ordinary
passport holders are required to have visa. These passport holders
with a valid Schengen or OECD member's visa or residence permit may
get their single entry e-Visas valid for one month e-Visas via the
website www.evisa.gov.tr, provided that they meet certain conditions.