If I use the plain past tense of a verb before とき, do I have to use the plain past tense in the sentence that comes after it, or is it okay to use the polite past tense? For example, I'm trying to say, "When I went to Japan, I did not ride the shinkansen."
日本に行ったとき、新幹線に乗らなかった。
vs.
日本に行ったとき、新幹線に乗りませんでした。
Are they both correct? If so, which one is preferred? There's an example on this page that uses the polite past in the sentence that comes after とき.
日本へ行ったとき、カメラを買いました。