asp.net 母版页、内容页
我有一个包含三个部分的母版页,左窗格 + 2 个右窗格(一个顶部标题和一个主屏幕区域)
我想让主屏幕区域根据顶部标题窗格中的链接单击动态填充 URL。
因此,在标题中,如果我有三个链接 - 假设我有三个页面(one.aspx、two.aspx、三.aspx),并且我想单击母版标题窗格中的一、二、三链接,并获得内容加载到主区域中每个关联子页面的主区域中。
有什么想法吗?
i have a master page with three sections, left pane + 2 right panes (one top header and one main screen area)
i want to have the main screen area dynamically fill a url based on a link click from the top header pane.
so in the header if i have three links - assume i have three pages (one.aspx, two.aspx, three.aspx) and i want to click a one, two, three link in the header pane of the master and have the content load in the main area of each associated child page in the main areas.
any idea?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
ASP .NET 母版页的要点是准确地执行您想要的操作,而不需要填充页面的区域。
我建议做的是将每页不改变的内容(例如左窗格和顶部标题/右窗格)移动到母版页中。并为您的主屏幕创建一个内容占位符。
然后创建您的 one.aspx、two.aspx、third.aspx 页面并让它们使用您的新母版页。现在,当您编辑页面时,您将编辑的唯一区域将是主屏幕区域的内容。
您在主页上所做的任何更改都将立即反映在所有三个页面上,而无需更新每一页。
如果您有不同的目标,请告诉我。我会尽我所能提供帮助。
The point of ASP .NET master pages are to do exactly what you are wanting without needing to fill areas of the page.
What I would suggest doing is moving the content that does not change per page (e.g. left pane and the top header/right pane) into the master page. and create a contentplaceholder for your main screen.
Then create your one.aspx, two.aspx, three.aspx pages and have them use your new master page. Now, when you edit the pages, the only area you will edit will be the content for the main screen area.
Any changes you make on the master page will be immediately reflected on all three pages without having to update each one.
If you had a different goal in mind please let me know. I'll do what I can to help.
创建页面时,您应该选择母版页。
在每个页面上,您填充母版页的内容区域。
因此,如果您想链接到您的页面,您可以将链接放在每个页面的 Head ContentPlaceHolder 中。因此,您直接链接到“one.aspx”、“two.aspx”和“two.aspx”。
每个页面都会在请求时加载其 MasterPage 内容。所以它的工作原理就像不包含框架(忘记框架)。
When you created your pages you should have selected the MasterPage.
On each page you fill the content areas of your MasterPage.
So if you want to link to your pages you can put the links in each page's Head ContentPlaceHolder. So you link to 'one.aspx', 'two.aspx' and 'three.aspx' directly.
Each page will load it's MasterPage contents when it's requested. So it works like includes not frames (forget frames).
只需使用布局 div 创建母版页,然后使用 在内容选项卡中留下占位符即可。
接下来创建一个新页面,使用您的母版页作为基础,并在自动生成的标签内放置该页面的特定内容。
为您希望标题链接指向的每个内容页面创建一个继承母版页的新页面。
嘿,很快就不需要框架或脚本了。
Just create your master page with your layout divs and use the to leave a place holder inside your content tab.
Next create a new page that uses your master page as its base and inside the automatically generated tag put your specific content for that page.
Create a new page inheriting the master page for each content page you want the header links to point to.
Hey presto no need for frames or script.
我不确定我完全遵循你的意图,但如果我确实明白了,在我看来,你想要的是一个浮动框架。
I'm not sure I completely follow your intent, but if I do get it, it sounds to me like what you want is a floating frame.