473,387 Members | 1,553 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

MasterPages - take plain form, add MasterPage. MasterPage does NOT appear when run

Hi,
I now need to add MasterPages to a number of existing forms, but when I add
the code for MasterPage, the MasterPage does NOT appear when it runs.

Any thoughts?

TIA, Randy Smith
Apr 13 '07 #1
8 2070
bpd
On Apr 13, 2:31 pm, "Randy Smith" <rsm...@cta.orgwrote:
Hi,
I now need to add MasterPages to a number of existing forms, but when I add
the code for MasterPage, the MasterPage does NOT appear when it runs.

Any thoughts?

TIA, Randy Smith
Make sure your Page directive includes MasterPageFile=<your master
page here>. For example, from one of my projects:
<%@ Page Language="C#" MasterPageFile="~/rc.master"
AutoEventWireup="true" CodeFile="Modifier_Customer.aspx.cs"
Inherits="Modifier_Customer" Title="Customer Modifier" %>

Apr 13 '07 #2
"Randy Smith" <rs****@cta.orgwrote in message
news:%2****************@TK2MSFTNGP06.phx.gbl...
I now need to add MasterPages to a number of existing forms, but when I
add the code for MasterPage, the MasterPage does NOT appear when it runs.

Any thoughts?
Well, firstly, what do you mean by "existing forms"...? When you say "form",
do you mean ASPX page...?

How do you "add the code for MasterPage"...?
Apr 13 '07 #3
Sorry, but what you saying is not very understandable. I can understand each
word separately but not the whole sentce :)

Anyway in order to use master page you need to have reference to it on your
main page
<%@ Page Language="C#" MasterPageFile="~/MasterPage.master"%>

Master page shoudl have something like

<asp:contentplaceholder id="ContentPlaceHolder1" runat="server">

</asp:contentplaceholder>

somewere. It's where content will go

And the page should have
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1"
Runat="Server">

CONTENT

</asp:Content>
The best thing for you to do is to create one dummy page with master page
using wizard and look how it's done

George
"Randy Smith" <rs****@cta.orgwrote in message
news:%2****************@TK2MSFTNGP06.phx.gbl...
Hi,
I now need to add MasterPages to a number of existing forms, but when I
add the code for MasterPage, the MasterPage does NOT appear when it runs.

Any thoughts?

TIA, Randy Smith

Apr 13 '07 #4
Hi,
I have an existing web site, but now need to add MasterPages. So, I've
taken existing aspx.pages and added this code:
MasterPageFile="MasterPage.master"

I've made sure that my html form elements are wrapped in:

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1"
Runat="Server">

AND ..................... </asp:Content>

IN SPITE OF THIS, my MasterPage elements do NOT appear.

TIA, Randy Smith
"Mark Rae" <ma**@markNOSPAMrae.netwrote in message
news:ub*************@TK2MSFTNGP05.phx.gbl...
"Randy Smith" <rs****@cta.orgwrote in message
news:%2****************@TK2MSFTNGP06.phx.gbl...
>I now need to add MasterPages to a number of existing forms, but when I
add the code for MasterPage, the MasterPage does NOT appear when it runs.

Any thoughts?

Well, firstly, what do you mean by "existing forms"...? When you say
"form", do you mean ASPX page...?

How do you "add the code for MasterPage"...?

Apr 13 '07 #5
"Randy Smith" <rs****@cta.orgwrote in message
news:eA**************@TK2MSFTNGP03.phx.gbl...
I have an existing web site, but now need to add MasterPages. So, I've
taken existing aspx.pages and added this code:
MasterPageFile="MasterPage.master"
So your MasterPage is in the same folder as all your content pages...?
I've made sure that my html form elements are wrapped in:

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1"
Runat="Server">

AND ..................... </asp:Content>
By "wrapped in", I take it that you have removed all of the other <html>
tags like <header>, <bodyetc from your content pages...?
Apr 13 '07 #6
Well, I did have the MasterPages in the same folder, then I tried placing
the MasterPage in my main website folder, but that didn't seem to make any
difference either. Here's what my solution folders look like:

/GWO (.NET 2005 solution)
/Web
- Login aspx.form (redirects to appropriate folder based on
user role)
/OffSvcs
- aspx forms
- MasterPage (for Office Services employees)
/User
- aspx forms
- MasterPage (for general users)
/AcctUser
- aspx forms
- MasterPage (for accounting users)
/GWO (class libraries and datamappers)

TIA, Randy

"Mark Rae" <ma**@markNOSPAMrae.netwrote in message
news:e0*************@TK2MSFTNGP04.phx.gbl...
"Randy Smith" <rs****@cta.orgwrote in message
news:eA**************@TK2MSFTNGP03.phx.gbl...
>I have an existing web site, but now need to add MasterPages. So, I've
taken existing aspx.pages and added this code:
MasterPageFile="MasterPage.master"

So your MasterPage is in the same folder as all your content pages...?
>I've made sure that my html form elements are wrapped in:

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1"
Runat="Server">

AND ..................... </asp:Content>

By "wrapped in", I take it that you have removed all of the other <html>
tags like <header>, <bodyetc from your content pages...?

Apr 13 '07 #7
Well,
I think it's been solved for those interested. Apparently, the following
code must "live" by itself. I had objects placed within it, but it just
didn't work. So, the contentplaceholder statements are below the objects.
<asp:contentplaceholder id="ContentPlaceHolder1" runat="server">

</asp:contentplaceholder>


"Randy Smith" <rs****@cta.orgwrote in message
news:Ov**************@TK2MSFTNGP06.phx.gbl...
Well, I did have the MasterPages in the same folder, then I tried placing
the MasterPage in my main website folder, but that didn't seem to make any
difference either. Here's what my solution folders look like:

/GWO (.NET 2005 solution)
/Web
- Login aspx.form (redirects to appropriate folder based on
user role)
/OffSvcs
- aspx forms
- MasterPage (for Office Services employees)
/User
- aspx forms
- MasterPage (for general users)
/AcctUser
- aspx forms
- MasterPage (for accounting users)
/GWO (class libraries and datamappers)

TIA, Randy

"Mark Rae" <ma**@markNOSPAMrae.netwrote in message
news:e0*************@TK2MSFTNGP04.phx.gbl...
>"Randy Smith" <rs****@cta.orgwrote in message
news:eA**************@TK2MSFTNGP03.phx.gbl...
>>I have an existing web site, but now need to add MasterPages. So, I've
taken existing aspx.pages and added this code:
MasterPageFile="MasterPage.master"

So your MasterPage is in the same folder as all your content pages...?
>>I've made sure that my html form elements are wrapped in:

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1"
Runat="Server">

AND ..................... </asp:Content>

By "wrapped in", I take it that you have removed all of the other <html>
tags like <header>, <bodyetc from your content pages...?


Apr 13 '07 #8
"Randy Smith" <rs****@cta.orgwrote in message
news:%2****************@TK2MSFTNGP04.phx.gbl...
I think it's been solved for those interested. Apparently, the following
code must "live" by itself. I had objects placed within it, but it just
didn't work. So, the contentplaceholder statements are below the objects.
<asp:contentplaceholder id="ContentPlaceHolder1" runat="server">

</asp:contentplaceholder>
That's what I said. Content pages do not have all of the "top and tail" of
regular pages - their MasterPage provides those...
Apr 14 '07 #9

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: suzy | last post by:
Hello, I have created a template for my website using the masterpages template technique. It's working fine, except when I try to print the value of a querystring parameter in my HTML code, I...
6
by: VR | last post by:
Hi, I read about Master Pages in ASP.Net 2.0 and after implementing some WinForms Visual Inheritance I tryed it with WebForms (let's say .aspx pages, my MasterPage does not have a form tag itself...
2
by: iturner100 | last post by:
Hi, I've been struggling with this one for a couple of hours without much joy. Basically, I've got a set of nested masterpages (3 as it happens). I'm dynamically generating a new page in code...
0
by: Learner | last post by:
Hello, I have one MasterPage (it has Header and Side lay out on it) and it has 3 component placeholders. Out of which the side one for the links to navigate through the site, the Header place is...
5
by: Nick Wouters | last post by:
Dear All In Classic ASP I used CSS for ALL layout. Now in ASP.NET version 2 I am testing out Masterpages as they come in very handy. It seems like it is replacing CSS for layout but what is...
23
by: LvBohemian | last post by:
I am playing around with creating some menus dynamically, and they create fine and show up ok when I want them to; but when I select a menu NavigateUrl at run time, the applicable url shows up...
9
by: RBM007 | last post by:
Hello, I have created some pages in the (old) Atlas pages and migrated to AJAX version. After the update I noticed that any page containing ASP.NET AJAX won't compile anymore. Even if the same...
0
by: HockeyFan | last post by:
I've done this many times with average pages, but in a case I have now, I have a master page with some controls on it. Under certain conditions when the user selects certain options, I want to...
8
by: Mort Strom | last post by:
Right now the header of my master page contains all of the CSS styles for all of the pages that might be loaded in my ContentPlaceHolder. The problem is that my <styletag is getting too large to...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.