473,503 Members | 1,650 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

ASCX as Header/Footer

Hello,

I want to create a Header and Footer for every ASPX page I build. I
created 2 Web user controls respectively and placed them in an ASPX page.
The problem is that I cannot position the Footer to be always at the
bottom of the page. The Header and Footer are always together at the top
of the page.

Was I missing anything? Thanks!

--
Peter Wu
Powered by Microsoft Windows XP [Version 5.1.2600]
Nov 17 '05 #1
11 8303
Sounds like an html prob.

A usercontrol will show up where it has been placed with in your document
structure. Similar to SSI.

"Peter Wu" <pe*****@hotmail.com> wrote in message
news:bg************@ID-117651.news.uni-berlin.de...
Hello,

I want to create a Header and Footer for every ASPX page I build. I
created 2 Web user controls respectively and placed them in an ASPX page.
The problem is that I cannot position the Footer to be always at the
bottom of the page. The Header and Footer are always together at the top
of the page.

Was I missing anything? Thanks!

--
Peter Wu
Powered by Microsoft Windows XP [Version 5.1.2600]

Nov 17 '05 #2
Ron Vecchi <ve******@comcast.net> wrote:
Sounds like an html prob.

A usercontrol will show up where it has been placed with in your
document structure. Similar to SSI.


The problem is that I cannot move it to the bottom of the page. :-(

--
Peter Wu
Powered by Microsoft Windows XP [Version 5.1.2600]
Nov 17 '05 #3
Double check to make sure your HTML is well formed in your page and ASCX
(and the combined HTML output.)
Even if it was well formed to begin with, sometimes the designer "helps" you
by adding closing HTML elements in places where you didn't want them.

--
I hope this helps,
Steve C. Orr, MCSD
http://Steve.Orr.net
"Peter Wu" <pe*****@hotmail.com> wrote in message
news:bg************@ID-117651.news.uni-berlin.de...
Ron Vecchi <ve******@comcast.net> wrote:
Sounds like an html prob.

A usercontrol will show up where it has been placed with in your
document structure. Similar to SSI.


The problem is that I cannot move it to the bottom of the page. :-(

--
Peter Wu
Powered by Microsoft Windows XP [Version 5.1.2600]

Nov 17 '05 #4
Steve C. Orr, MCSD <St***@Orr.net> wrote:
Just drag or cut/paste the footer control down to the bottom of the page
where you want it.


Unfortunately, it does not work. :(

Here goes my page in HTML. Thanks.
<%@ Page language="c#" Codebehind="Login.aspx.cs" AutoEventWireup="false"
Inherits="WUTT.Login" %>
<%@ Register TagPrefix="uc1" TagName="Header" Src="Header.ascx" %>
<%@ Register TagPrefix="uc1" TagName="Footer" Src="Footer.ascx" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<HTML>
<HEAD>
<title>Login</title>
<meta name="GENERATOR" Content="Microsoft Visual Studio .NET 7.1">
<meta name="CODE_LANGUAGE" Content="C#">
<meta name="vs_defaultClientScript" content="JavaScript">
<meta name="vs_targetSchema"
content="http://schemas.microsoft.com/intellisense/ie5">
<LINK href="Style.css" type="text/css" rel="stylesheet">
</HEAD>
<body ms_positioning="GridLayout">
<p></p>
<form id="Form1" method="post" runat="server">
<uc1:Header id="Header1" runat="server"></uc1:Header>

<asp:TextBox id="txtUsername" style="Z-INDEX: 101; LEFT: 462px;
POSITION: absolute; TOP: 187px"
runat="server" Width="240px" tabIndex="1" Height="22"></asp:TextBox>
<asp:TextBox id="txtPassword" style="Z-INDEX: 102; LEFT: 462px;
POSITION: absolute; TOP: 216px"
runat="server" Width="240px" TextMode="Password" tabIndex="2"
Height="22"></asp:TextBox>
<DIV style="DISPLAY: inline; Z-INDEX: 103; LEFT: 330px; WIDTH: 121px;
POSITION: absolute; TOP: 187px; HEIGHT: 22px"
ms_positioning="FlowLayout">
<P>Username:</P>
</DIV>
<DIV style="DISPLAY: inline; Z-INDEX: 104; LEFT: 330px; WIDTH: 121px;
POSITION: absolute; TOP: 216px; HEIGHT: 22px"
ms_positioning="FlowLayout">Password:</DIV>
<asp:Button id="btnLogin" style="Z-INDEX: 105; LEFT: 489px; POSITION:
absolute; TOP: 270px"
runat="server" Width="104px" Text="Login" tabIndex="2"
Height="24px"></asp:Button><INPUT style="Z-INDEX: 106; LEFT: 599px; WIDTH:
104px; POSITION: absolute; TOP: 270px; HEIGHT: 24px"
type="reset" size="100px" value="Reset" tabIndex="3">
<asp:Label id="lblWarning" style="Z-INDEX: 107; LEFT: 339px; POSITION:
absolute; TOP: 331px"
runat="server" Width="366px" Visible="False" Font-Overline="True"
Font-Underline="True"
Font-Bold="True" ForeColor="Red" Height="7px">* Bad username or
password. Please try again!</asp:Label>
<DIV style="DISPLAY: inline; Z-INDEX: 108; LEFT: 80px; WIDTH: 206px;
POSITION: absolute; TOP: 50px; HEIGHT: 28px"
ms_positioning="FlowLayout">
<P>Login</P>
</DIV>
<DIV style="DISPLAY: inline; FONT-SIZE: larger; Z-INDEX: 109; LEFT:
288px; WIDTH: 384px; POSITION: absolute; TOP: 120px; HEIGHT: 16px"
ms_positioning="FlowLayout">Welcome! Please enter your username and
password.
</DIV>

<uc1:Footer id="Footer1" runat="server"></uc1:Footer>
</form>
</body>
</HTML>

--
Peter Wu
Powered by Microsoft Windows XP [Version 5.1.2600]
Nov 17 '05 #5
I use all user controls on most of my sites. I use header, top navigation,
left navigation content to the right and a footer. Each of these elements is
a user control. The trick is to be sure that your code makes sense from top
to bottom tracking it all the way through your user controls as if it were
one page without user controls.

There is an example of this method at http://islandclub.us

HTH
"Peter Wu" <pe*****@hotmail.com> wrote in message
news:bg************@ID-117651.news.uni-berlin.de...
Hello,

I want to create a Header and Footer for every ASPX page I build. I
created 2 Web user controls respectively and placed them in an ASPX page.
The problem is that I cannot position the Footer to be always at the
bottom of the page. The Header and Footer are always together at the top
of the page.

Was I missing anything? Thanks!

--
Peter Wu
Powered by Microsoft Windows XP [Version 5.1.2600]

Nov 17 '05 #6
Steve C. Orr, MCSD <St***@Orr.net> wrote:
Double check to make sure your HTML is well formed in your page and ASCX
(and the combined HTML output.)
Even if it was well formed to begin with, sometimes the designer
"helps" you by adding closing HTML elements in places where you didn't
want them.


I think ASP.NET generates the HTML code correctly. Now, it is the IE
problem. Why doesn 't IE display the copyright claim at the bottom?
Thanks.
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<HTML>
<HEAD>
<title>Login</title>
<meta name="GENERATOR" Content="Microsoft Visual Studio .NET 7.1">
<meta name="CODE_LANGUAGE" Content="C#">
<meta name="vs_defaultClientScript" content="JavaScript">
<meta name="vs_targetSchema"
content="http://schemas.microsoft.com/intellisense/ie5">
<LINK href="Style.css" type="text/css" rel="stylesheet">
</HEAD>
<body>
<form name="Form1" method="post"
action="Login.aspx?ReturnUrl=%2fWUTT%2fMainMenu.as px" id="Form1">
<input type="hidden" name="__VIEWSTATE"
value="dDw2MjkwNDU3Mzg7Oz75y+cu2/Z/dMJFgwdibwILNJVAyg==" />

<input name="txtUsername" type="text" id="txtUsername" tabindex="1"
style="height:22px;width:240px;Z-INDEX: 101; LEFT: 462px; POSITION:
absolute; TOP: 187px" />
</form>

<div>Copyright
This program is protected by
US and international copyright law.</div>

</body>
</HTML>


--
Peter Wu
Powered by Microsoft Windows XP [Version 5.1.2600]
Nov 17 '05 #7
Try putting the header and footer into separate files.
That way you can use them anywhere you want.

HTH
-----Original Message-----
Hello,

I want to create a Header and Footer for every ASPX page I build. Icreated 2 Web user controls respectively and placed them in an ASPX page.The problem is that I cannot position the Footer to be always at thebottom of the page. The Header and Footer are always together at the topof the page.

Was I missing anything? Thanks!

--
Peter Wu
Powered by Microsoft Windows XP [Version 5.1.2600]
.

Nov 17 '05 #8
Why not try creating a base page class that already has
the header and footer interface defined. Then all your
pages can just derive from this.

-----Original Message-----
Hello,

I want to create a Header and Footer for every ASPX page I build. Icreated 2 Web user controls respectively and placed them in an ASPX page.The problem is that I cannot position the Footer to be always at thebottom of the page. The Header and Footer are always together at the topof the page.

Was I missing anything? Thanks!

--
Peter Wu
Powered by Microsoft Windows XP [Version 5.1.2600]
.

Nov 17 '05 #9
Rory <ro**@vivid-design.com.au> wrote:
Why not try creating a base page class that already has
the header and footer interface defined. Then all your
pages can just derive from this.


Any samples how to do this? Thanks.

--
Peter Wu
Powered by Microsoft Windows XP [Version 5.1.2600]
Nov 17 '05 #10
Steve C. Orr, MCSD <St***@Orr.net> wrote:
OIC, it looks like you are using GridLayout.
Notice how all your web controls have pixel positions listed? Well your
header and footer do not. This is basically the same as saying that
the top & left are 0,0 (at the top of the form)
Either give them pixel positions or switch your page to Flow Layout and
get rid of all the positioning HTML code.


I still use GridLayout for the form and give the Footer the pixel position
like this:

<uc1:Footer id="Footer1" runat="server" style="Z-INDEX: 107; LEFT: 0px;
POSITION: absolute; TOP: 500px"></uc1:Footer>

But it does not help. The rendered HTML just loses the position specified.
Please help!

--
Peter Wu
Powered by Microsoft Windows XP [Version 5.1.2600]
Nov 17 '05 #11
this is because you are using absolute positioning in the input control
"Peter Wu" <pe*****@hotmail.com> wrote in message
news:bg************@ID-117651.news.uni-berlin.de...
Steve C. Orr, MCSD <St***@Orr.net> wrote:
Double check to make sure your HTML is well formed in your page and ASCX
(and the combined HTML output.)
Even if it was well formed to begin with, sometimes the designer
"helps" you by adding closing HTML elements in places where you didn't
want them.


I think ASP.NET generates the HTML code correctly. Now, it is the IE
problem. Why doesn 't IE display the copyright claim at the bottom?
Thanks.
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<HTML>
<HEAD>
<title>Login</title>
<meta name="GENERATOR" Content="Microsoft Visual Studio .NET 7.1">
<meta name="CODE_LANGUAGE" Content="C#">
<meta name="vs_defaultClientScript" content="JavaScript">
<meta name="vs_targetSchema"
content="http://schemas.microsoft.com/intellisense/ie5">
<LINK href="Style.css" type="text/css" rel="stylesheet">
</HEAD>
<body>
<form name="Form1" method="post"
action="Login.aspx?ReturnUrl=%2fWUTT%2fMainMenu.as px" id="Form1">
<input type="hidden" name="__VIEWSTATE"
value="dDw2MjkwNDU3Mzg7Oz75y+cu2/Z/dMJFgwdibwILNJVAyg==" />

<input name="txtUsername" type="text" id="txtUsername" tabindex="1"
style="height:22px;width:240px;Z-INDEX: 101; LEFT: 462px; POSITION:
absolute; TOP: 187px" />
</form>

<div>Copyright
This program is protected by
US and international copyright law.</div>

</body>
</HTML>


--
Peter Wu
Powered by Microsoft Windows XP [Version 5.1.2600]

Nov 17 '05 #12

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

Similar topics

2
1290
by: Wade Beasley | last post by:
I have a web project that currently has a standard header, footer, and menu ascx files. I am now suppose to change the project to allow a user to choose from 3 different views, ie 3 different...
1
1351
by: ronaldoveira | last post by:
I have a to create a page that according the parameters it takes, it has to read a .txt file from disk and display as the content. The .txt file contains html text. The display page is composed...
6
2764
by: tshad | last post by:
I have an ascx file I am using to include my logos and heading information for all my pages. It was working fine up until now. I decided to set up an admin folder inside of my main folder and...
2
9243
by: LilBuh | last post by:
hi there :) i ve been looking for some time a way to print an html file from vb.net i came up with this code for printing and removing the header and footer from IE then once the printing is done...
0
1887
by: LilBuh | last post by:
Hello :) this is a repost... i ve been looking for a way since last week ... i have a template html file that i modify from my code... i need to print this file without IE's Header and Footer or...
7
9504
by: Neil Jarman | last post by:
Hi, I would like to allow users to print a page, but I want to suppress the header and footer that appear by default. I gather its done with a style sheet. Please advise. Many Thanks,
7
8688
by: xkeops | last post by:
Thinking of creating a website, most of the pages will have a general toolbar menu, a content and a footer. The content will be the only one who's gonna change but the rest (header,footer) will...
7
1719
by: WT | last post by:
Hello, Is it possible to use something like materpages in acsx controls ? Thanks for help. CS
1
2705
by: KoosHopeloos | last post by:
L.S., I'm trying to make a layout which is completely fixed in width and height if needed by using three divs rows (header, content, footer) which have each 3 div again to be able to play around...
0
7084
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
1
6991
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...
0
7458
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5578
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,...
0
4672
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3154
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1512
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 ...
1
736
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
380
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...

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.