asp.net - Is there any possibility to add master page for more then one existing .aspx page? -


i made update.aspx page , view.aspx page want assign master page these pages...can me out ?

create new master page names site.master, move want update.aspx master, head section html content, , in body put placeholder:

<asp:contentplaceholder runat="server" id="maincontent" /> 

now when "shared" master content moved update.aspx/view.aspx, need wrap that's left in pages this:

<asp:content runat="server" id="bodycontent" contentplaceholderid="maincontent">   update.aspx page content </asp:content> 

in first line of page should have <%@ page ... attributes ... %>, add new attribute points master page: masterpagefile="~/site.master"

for reference, create new webforms project , you'll few sample pages. see how should html content in master page like, , how wrap page content of aspx page.

end result should this:
site.master

<html><head>...</head> <body>     master body html content     <asp:contentplaceholder runat="server" id="maincontent" />     more html here </body> <html> 

then page:

<asp:content runat="server" id="bodycontent" contentplaceholderid="maincontent">       update.aspx page content </asp:content> 

Comments

Popular posts from this blog

Hatching array of circles in AutoCAD using c# -

ios - UITEXTFIELD InputView Uipicker not working in swift -

Python Pig Latin Translator -