I boken Sauron fängslades aldrig Gandalf (så svaret är för att det skulle skada Peter Jacksons prequels-plot ):
I Hobbits tid (eller tidigare) mötte de två gånger, först 2063 när Gandalf gick till Dol Guldur och Sauron (då kallad Necromancer) flydde eftersom han inte var tillräckligt stark ännu ( detta är inte täckt i "The Hobbit", men i "Ringenes Herre", Bilaga B, "The Third Age", trots att det hände under när Hobbit höll ).
2063 - Gandalf goes to Dol Guldur. Sauron retreats and hides in the East...
Andra gången, under jakten på Erebor, attackerar Vita rådet Dol Guldur, där Sauron återvände igen. Han "flyr" igen ( samma källa ).
2850 - Gandalf again enters Dol Guldur, and discovers that its master is indeed Sauron. who is gathering all the Rings and seeking for news of the One, and of Isildur's Heir. He finds Thráin and receives the key of Erebor. Thráin dies in Dol Guldur.
2941 - ... The White Council meets; Saruman agrees to an attack on Dol Guldur, since he now wishes to prevent Sauron from searching the River. Sauron having made his plans abandons Dol Guldur.
Dessutom berättar Gandalf hur de senare händelserna på Dol Guldur hände under Elrondrädets råd:
But Saruman has long studied the arts of the Enemy himself, and thus we have often been able to forestall him. It was by the devices of Saruman that we drove him from Dol Guldur. It might be that he had found some weapons that would drive back the Nine ...
... 'Some here will remember that many years ago I myself dared to pass the doors of the Necromancer in Dol Guldur, and secretly explored his ways, and found thus that our fears were true: he was none other than Sauron, our Enemy of old, at length taking shape and power again. Some, too, will remember also that Saruman dissuaded us from open deeds against him, and for long we watched him only. Yet at last, as his shadow grew, Saruman yielded, and the Council put forth its strength and drove the evil out of Mirkwood and that was in the very year of the finding of this Ring: a strange chance, if chance it was.
'But we were too late, as Elrond foresaw. Sauron also had watched us, and had long prepared against our stroke, governing Mordor from afar through Minas Morgul, where his Nine servants dwelt, until all was ready. Then he gave way before us, but only feigned to flee, and soon after came to the Dark Tower and openly declared himself.
De kolliderade aldrig direkt i LOTR-tidslinjen, den enda gången Gandalf fängslades av Saruman - se nedan.
Om du menade Saruman (inte Sauron), som faktiskt fängslade Gandalf (under LOTR-tid):
Saruman hoppades att få Gandalf att berätta för honom var One Ring var.
'He was cold now and perilous. "Yes," he said. "I did not expect you to show wisdom, even in your own behalf; but I gave you the chance of aiding me willingly. and so saving yourself much trouble and pain. The third choice is to stay here, until the end."
' "Until what end?"
' "Until you reveal to me where the One may be found. I may find means to persuade you. Or until it is found in your despite, and the Ruler has time to turn to lighter matters: to devise, say, a fitting reward for the hindrance and insolence of Gandalf the Grey."
(The Fellowship of the Ring, Chapter II: The Council OF Elrond)