Is there an alternative to using Frames to combine multiple aspx files into a single page?

时间秒杀一切 提交于 2020-01-05 07:11:31

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!