将主文件添加到页面 [英] adding master file to page

查看:91
本文介绍了将主文件添加到页面的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述





我想在aspx页面中添加母版页参考但是我收到错误:



Hi,

I am trying to add master page reference in the aspx page but i get the error:

"

Content controls have to be top-level controls in a content page or a nested master page that references a master page.







如何添加这个?



谢谢,

Rami


"

How can I add this?

Thanks,
Rami

推荐答案

内容页面中的所有内容都应该包含在内部

All your content in the Content Page should be wrapped inside
<asp:content .. 



标记对应于


tag that corresponds to the

<asp:ContentPlaceHolder ..


主页的


简单快捷的解决方案是创建一个新页面,同时从Template中添加页面,如果您使用Visual Studio开发应用程序,请确保已选中Checkbox以引用MasterPage,并在下一个屏幕中选择母版页。然后只需复制包含在表格标签内的现有页面的内容(通常)。



查看此链接 -

http://www.brainbrushups.com/2013/05/create-master -page-and-content-page-in.html [ ^ ]



希望,它有帮助:)



如果您的问题仍然存在,请分享相关代码,以便我们确定实际问题。


of your masterpage.
The simple and quick solution is to create a new page and while make adding the page from Template, make sure that you have checked the Checkbox for referencing MasterPage if you are using Visual Studio to develop your application and in the next screen select the masterpage. Then just copy the content of your existing page which is wrapped inside form tag (normally).

Check this link-
http://www.brainbrushups.com/2013/05/create-master-page-and-content-page-in.html[^]

Hope, it helps :)

If your problem still exists, please share the relevant code so that we can identify actual issue.


这篇关于将主文件添加到页面的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆