Is the screen spline still there? That's the round cord-like stuff that holds the screen in the channel in the frame. Sometimes it's not round - may be triangular for example. If it's still there, you may be able to re-position the screen over the channel in the frame and press the screen back into the channel with the spline to hold it in position. Quite often though, the spline has shrunk or dried out which is why it let the screen escape, and if you put it back together with the original screen and spline, it'll only be a temporary repair. But, it's worth a shot since it won't cost you anything to try it.
They sell screen spline tools at hardware stores or big lumber yards. They are a handle with a wheel on each end. One of the wheels has a groove in it to hold the spline while you start pressing it into the channel on the frame, and then you use the fully round wheel to finish pressing the spline completely into the channel. But, if you only have a small section to put back in, a blunt screwdriver, popsicle stick, or even your fingers will work ok. Just be careful not to rip the screen while putting it back together.
If you decide to buy new spline, bring a piece of the old spline with you as it comes in different diameters.