Here are my answers (mostly from my experience), and by the way, the other answers above and below too are gems of knowledge worth any teacher's time (I have already made a note of all of them :)) -
1) Make sure you are teaching what students will find useful, and show them how / why this will be useful. Show them its relevance.
(If you feel it is not, you need to ask yourself why you are teaching it in the first place. And yes - it can come in the exam is as excellent a reason as "you will end up using this in your first year at work when xxxx happens")
2) Use Von Restroff effect to your advantage.
Every 10-15 minutes, add / change something to break the monotony. Students like that. Say something funny, ask them questions
3) I tend to use the white board a lot, and many of my students like this as it gives them time to write. I also use cartoons as it helps them remember things better and makes them smile and thus remember by association. (Confession: I am a bad artist, which makes this even more effective!)
4) Reconsider if you really wish to upload ppts before the class - Students have told me that when all the ppts are uploaded in advance, they sometimes feel there is sometimes no good reason to come to class. They after all do not know that you have planned somethign additional
5) Related to 4 above - write your ppts such that they can only be understood if a person sat through your class. I tend to write questions in my ppts which are only answered in class (often through discussion)
6) Involve your students in activities. And do something (related to the subject!) that they will talk about later. This makes students who were absent curious, and they turn up next time sheerly for the entertainment value. It is left upto you next to merge this entertainment with teh topic at hand
7) Use good and creative videos - I used a vlog by Superwoman (!) to make my students understand how not to do their assignments. They loved it. And for the first time, there was not a single late submission.
8) Use Activities as far as possible ( My kpi is one activity per class - even if it is a short 5 minute discussion with their seat mate. I know I am saying this twice) -
Similarly, to teach the various downstream and upstream legs in supply chain management, I used DHL's short advert on hot pepper sauce from West Indies to China. This was followed by a team exercise where the students had to figure out each leg, and how this could be further optimized keeping in mind the restrictions of each country involved. The all discovered new hub ports in Miami, and our Jamaican and Chinese students were in much demand as students wanted to learn about transport systems and issues there.
9) Dont shout at students / Dont scold them unnecessarily
This may not suit everyone, but I dont like to scold students in class, as it insults them in the peer group / in front of other boys and girls and embarrasses them. Some of them show their resentment by not coming for future classes. If you need to tell them something, as far as possible say it in private, or if telling in public, put it in a jocular fashion.
10) One of my lecturer friends always invested in a small bowl of candy that he would keep out 30 minutes before his class was going to get over. It became a ritual and the candy always changed each time. There were always a few special ones that he knew his students liked (he actually asked them!) - and those students came initially (a) for the candy (!) and (b) because they felt that the teacher cared enough for him / her to do this extra action
11) Related to 10 above - do something different from other lecturers. This is actually easily - just do what comes naturally to you, and most of the time it will be different from others.
12) Always focus on students assignment topics / their future career aspirations and relate what you teach in class to these. It is best to do the former right at the beginning - it is interesting how those magic words "this forms part of the answer to your assignment essay blah blah" miraculously result in pens and notebooks coming out.
13) Lastly - don't take anything, including their absence personally (I know that is difficult, especially if you are a dedicated teacher). Remember, sometimes students do sleep late and wake up late, they sometimes miss buses and trains, and sometimes, they may just want to not come. At the end of the day, your are answerable to yourself and if you did your best, that is it.