问题
I am rewriting a site that contains around 10 separate frames which each display a bunch of separate aspx files.
Is there a modern-day equivalent to using Frames for combining multiple aspx files, without needing to rewrite all the individual aspx files that make up the frame's contents?
回答1:
How about turning the existing aspx pages into (user) controls? This would allow you to either dynamically add them (any/all, one or any number) to a single page or just statically (all ten) do so in markup.
You retain whatever rationale you had for creating 10 different pages while really wanting to display them together in some form/number yet maintain separation (in other/older platforms, this would be similar to include
files)
Converting aspx to ascx isn't too much work.
Depending on what you need next, you may need to do more work, likely using client side techniques (AJAX) if you want each of the controls functions not have to refresh the entire page (like in a frameset).
回答2:
An ASP.NET master page may be what you are looking for.
来源:https://stackoverflow.com/questions/12512532/is-there-an-alternative-to-using-frames-to-combine-multiple-aspx-files-into-a-si