473,695 Members | 2,372 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

question about page template - please help

hi,

i have created a aspx page template by creating a template.cs file which
inherits from the page class. In this file I override the OnInit event and
create a template in the form of a header, left menu and a footer. there is
also a body area where the main content of the page will go.

i created these 4 areas by dynamically creating a placeholder in each area
at runtime. in the template.cs i load user controls into each area except
for the body area (as this is meant to be populated by the main aspx page).

in my aspx page (which inherits the template class) if i create controls at
runtime i can simply reference the placeholder in the main body area, and
add a control to it at runtime.

my problem is that if i try and create controls at design time in my aspx
page, they appear before the header, rather than in the main body area.

i had a feeling i was creating my template in a wrong way when i did it,
because i was generating html code in my .cs file and it's hard to
read/maintain when you have several table cells.

can anyone please give me an example of how to create a template with a
header, left menu and a footer?

i have examples on the net but they all seem to be doing it in different
ways.

ps: i am a beginner to asp.net.
Nov 17 '05 #1
1 1476
Check out this article, this will help you. Here i have explained the basic
stuff of Page Template, how you need to create page templates. I have also
given links to various article which talks about Page Template
http://www.microsoft.com/india/msdn/articles/87.aspx

--
Saravana
Microsoft India Community Star,MC**
www.ExtremeExperts.com

"suzy" <me@nospam.co m> wrote in message
news:Oq******** ******@tk2msftn gp13.phx.gbl...
hi,

i have created a aspx page template by creating a template.cs file which
inherits from the page class. In this file I override the OnInit event and create a template in the form of a header, left menu and a footer. there is also a body area where the main content of the page will go.

i created these 4 areas by dynamically creating a placeholder in each area
at runtime. in the template.cs i load user controls into each area except
for the body area (as this is meant to be populated by the main aspx page).
in my aspx page (which inherits the template class) if i create controls at runtime i can simply reference the placeholder in the main body area, and
add a control to it at runtime.

my problem is that if i try and create controls at design time in my aspx
page, they appear before the header, rather than in the main body area.

i had a feeling i was creating my template in a wrong way when i did it,
because i was generating html code in my .cs file and it's hard to
read/maintain when you have several table cells.

can anyone please give me an example of how to create a template with a
header, left menu and a footer?

i have examples on the net but they all seem to be doing it in different
ways.

ps: i am a beginner to asp.net.

Nov 17 '05 #2

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

Similar topics

6
4436
by: Rainer Herbst | last post by:
Hi *, please consider the following problem: I have a XML document which includes some html elements. I want to replace only the <div> element: I specified two templates, one matches everything ("*"), one matches only the "div". As far as I understand, the most specific rule should apply, i.e. the div rule if the element is a <div>.
1
1644
by: MArc Baumgartner | last post by:
Hello all, I have got a Question about XSL:FO: A XML-File contains any customers. For every customer I have to generate a letter. This letter can contain - depending on the information about the customer - from 1 to 5 pages. On every page I have to put the relative page number (e.g. 1-5) and the absolute page number (e.g. 456). All letter should be in one
35
3341
by: .:mmac:. | last post by:
I have a bunch of files (Playlist files for media player) and I am trying to create an automatically generated web page that includes the last 20 or 30 of these files. The files are created every week and are named XX-XX-XX.ASX where the X's represent the date i.e. 05-22-05.asx The files are a specific format and will always contain tags like the following: <TITLE>My media file title</TITLE> <AUTHOR>Media file author</AUTHOR> <Ref href =...
11
1775
by: Random | last post by:
I'm confused about the proper use and usefulness of namespaces. I beleive I understand the purpose is so the developer can put classes within namespaces to essentially organize your code. And I understand that you declare your intention to use a namespace within a page through the "Inherits" attribute. I know that using "Inherits" isn't absolutely necessary, it's just recommended so the developer doesn't have to type out the entire...
4
1493
by: cgaden | last post by:
Hi everyone, I have a problem that I've been trying to figure out for a while but I just can't seem to get it right. I have the following XML fragment: <Page ID="x1" Schema="Folder"> -<Page ID="x10" Schema="Common"> --<Page ID="x100" Schema="Common" /> --<Page ID="x200" Schema="Common" /> --<Page ID="x300" Schema="Common" />
18
2076
by: yinglcs | last post by:
Hi, I have a newbie XSLT question. I have the following xml, and I would like to find out the children of feature element in each 'features' element. i.e. for each <featuresI would like to look up what each feature depends on and gerenate a text file. For example, in the following file, I would like to find out feature A depends on A1 and A2 and feature B depends on B1 and B2. And write that to a text file.
4
2692
by: TS | last post by:
Steven, i lost this message conversation from outlook express and made a post online (see last one on this page). Please answer it as it hasn't been yet. thanks The clientID of our controls have become very long since we have 2 master pages that our pages inherit from. Some team members at
4
2643
by: Goran Djuranovic | last post by:
Hi all, I am experiencing a strange thing happening with a "designer.vb" page. Controls I manually declare in this page are automatically deleted after I drop another control on a ".aspx" page. - Why is this happening? - Can I disable automatic declaration and have everything be declared manually? - Any other options to fix this? Thanks in advance. Goran Djuranovic
2
3077
by: thuythu | last post by:
Please help me.... I used and Javascript to view the data. But when i click button open a popup windows, then select data and click save button. The popup close and return the main page, but the textbox value in the main page is undefined ---------------------------------------- here are code main page: ------------------------------------------- <script language="JavaScript"> var thedata; var newwin; var thenumber; function...
0
8631
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9115
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8984
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8847
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
7661
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
4340
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4579
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3003
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
1976
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.