Jesus twice says we can ask for anything "in my name and I will do it" (John 14:13,14). Yet we've all prayed for something "in Jesus name" and not received it. It can rattle your faith, or shake your confidence in Scripture.
So what does it mean: "ask in my name and I will do it?" Jesus had just said said, "Anyone who has faith in me will do what I've been doing" (John 14:12). These three verses, John 14:12-14, are a unit (pericope) and mean something together that is lost if we only look at one verse.
To ask "in my name" means that we ask as his representative or envoy. We are representing him to do what he would otherwise do himself--like the Secretary of State goes "in the name" of the President. But the Secretary of State doesn't go to do what he wants to do. He goes to do with the President wants done.
That's why Jesus will do whatever we pray "in my name," because we are asking for what he wants. Not what we want. It's like praying "Thy will be done." To pray "in my name" is to ask for power to do what he wants done, not secret Christian code words to get our own will.