A bungee net didn't work for me - the hooks kept slipping off the net.
Most of the time I just drop my backpack in my Jannd grocery panniers. I keep the panniers on the bike, except when I need to switch to the babyseat. I drop my U-lock in there too.
But for while there I had a couple of those lightweight spring-type mountain carbiner/key rings attached to the loop top on my backpack and the bottom of one shoulder strap. I'd clip the backpack to the rack and wrapped a single bungee around the middle to keep it from slipping from side to side. But these days, it's faster to just drop the bag in my panniers.