Click here to Skip to main content
16,016,263 members
Please Sign up or sign in to vote.
5.00/5 (1 vote)
See more:
Good Evening Friends,
1. I have designed a webpage with two labels and two textbox and with a button.Just login form layout.
2. I have created the masterpage after the webpage.
3. In that master page i have added images, background color and so on.
4. I have tried to use the master page to the existing webpage

ERROR:
I am able to get the master page layout only, I can't see the labels, textboxes and buttons.

Please help me.

Thanks in advance.
Posted
Updated 1-Aug-12 2:57am
v2

The easiest way would be to add new a new page with the masterpage already set then copy what you have done in the original page into the content control.

If you want to do it manually then you have to make sure the masterpagefile is list in the page tag ie:
HTML
MasterPageFile="masterpage url"

Then add the content control with the corresponding ContentPlaceHolderID:
ASP.NET
<asp:content id="Content2" contentplaceholderid="ContentPlaceHolder1" runat="Server" xmlns:asp="#unknown"></asp:content>br mode="hold" />Then cut/paste your pages html into that... Note that all head and body html components should be removed as they are already covered in the master page.
 
Share this answer
 
Steps:
1. Create a Master Page
2. Apply Master Page via design mode in existing web page
3. Copy over the Content Containers
4. In your Web Form, move Web Controls and information into the proper Content Containers.

Here, have a look at this blog explaining steps to support existing page with Master page: How to apply a Master Page to Existing Webpage OR Easily convert An Existing Web Form to a Web Content Form(with a Master Page) [^]

Step-by-step: Video: Adding an ASP .NET Master Page to an existing project - YouTube[^]
 
Share this answer
 
Comments
Member 13725750 5-Apr-18 1:15am    
i have a master page and i was include few web forms... and i already created one web form how i can add that web form in my master page

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900