母版页链接创建其他页面后的其他页面 [英] Master Page Link Up to other pages after other pages are created
问题描述
我已经创建了一个单独的母版页面和一个职业页面...职业页面没有与母版页链接...
i已经完成了该carrer页面的设计和编码。 。现在我希望我的这个carrer页面应该与母版页面链接...这样主页页面和页脚的内容可以自动显示在carrers页面上...
所以如何cn我这样做...请帮帮我
这里......引用:这是我的职业网页指南...
我在哪里做什么..
<%@ Page 语言 = C# < span class =code-attribute> AutoEventWireup = true CodeFile = Career.aspx.cs 继承 = 职业 %>
<%@ 页 语言 = C# AutoEventWireup = true MasterPageFile = 〜/ SomeMasterPage.Master CodeFile = Career.aspx.cs 继承 = 职业 %>
参考 - 如何将母版页分配给现有的.aspx页面? [ ^ ]。
Quote:将此添加到您现有的aspx页面声明:
MasterP ageFile =〜/ SomeMasterPage.Master
还应该提到,要向页面添加页面特定内容,您还需要添加任何内容标签(在主页中定义) )到你的aspx页面:
< asp :content id = myContent contentplaceholderid = someContent runat = server xmlns:asp = #unknown >
//页面内容在这里
< / asp:content >
如果你不放然后使用主页面中的默认内容。
Hai
以上解决方案1工作正常,或者你可以做到这个
只是排除了Career页面(右键单击Career并单击从项目中排除)然后添加新表单并更改名称Career并选择母版页并单击确定。就像添加带有母版页的新页面一样。
然后打开< form>里面的career.aspx(排除页面)复制源代码。在ContentPlaceHolder1标签内的新Career.aspx页面中标记并粘贴,然后再转到carrer(排除)编码页面复制全部并粘贴到新的职业编码页面。
问候
Aravind
I have created a master page seperate and a Career page seperately...career page is not linked up with master page...
i have done al the designing and codings of that carrer page..and now i want that my this carrer page should b linked with master page...so that that contents of master page as header and footer can be automatically displayed on carrers page...
so how cn i do this...please help me out
Quote:this is my career page directry...
what shld i do n where..
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Career.aspx.cs" Inherits="Career" %>Here...
<%@ Page Language="C#" AutoEventWireup="true" MasterPageFile="~/SomeMasterPage.Master" CodeFile="Career.aspx.cs" Inherits="Career" %>
Refer - How to assign a master page to a existing .aspx page?[^].
Quote:Add this to your existing aspx Page declaration:
MasterPageFile="~/SomeMasterPage.Master"
Should also mention that to add page specific content to your Page you also need to add any Content tags (defined in your Master Page) to your aspx page also:
<asp:content id="myContent" contentplaceholderid="someContent" runat="server" xmlns:asp="#unknown"> // Page Content goes here </asp:content>
If you don't put these in then the default content from your Master Page is used instead.
Hai
The above solution 1 work fine,or u can do like this
just exclude that Career page(right click Career and click exclude from project) and then add new form and change name Career and choose master page and click ok . Like adding new page with master page.
Then open career.aspx(excluded page) copy source code inside <form> tag and paste in new Career.aspx page inside ContentPlaceHolder1 tag and again go to carrer(excluded) coding page copy all and paste in new career coding page.
Regards
Aravind
这篇关于母版页链接创建其他页面后的其他页面的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!