ASCX as Header/Footer

Ask a Question related to ASP.NET General, Design and Development.

  1. #1

    Default 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]


    Peter Wu Guest

  2. Similar Questions and Discussions

    1. Header & Footer Help
      I am trying to add a header to my PDF. When I go to the toolbar - document - and click on add/update/remove, nothing happens. I am not getting a pop...
    2. Customizing pager/header/footer
      I need to put web controls inside pager, header or footer parts of the datagrid. Any ideas?
    3. cfdocument with header & footer
      Well, I got it working using CFHTTP, throwing in a couple of comment tags I can check for to filter out the header and footer, but it's really silly...
    4. Passing Values from Header to footer of an DataList
      Hi I have a TextBox and a Button in Header of a DataList and a Label in the Footer of a DataList. How to pass the value in the TextBox to Lable on...
    5. include() header and footer
      I'm ashamed that I need to ask this question. I've been using PHP for almost a year now, and have used HTML extensively in the last few years. ...
  3. #2

    Default Re: ASCX as Header/Footer

    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" <peterwu@hotmail.com> wrote in message
    news:bgbvl5$n8ima$1@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]
    >
    >

    Ron Vecchi Guest

  4. #3

    Default Re: ASCX as Header/Footer

    Ron Vecchi <vencenzo@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]


    Peter Wu Guest

  5. #4

    Default Re: ASCX as Header/Footer

    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
    [url]http://Steve.Orr.net[/url]


    "Peter Wu" <peterwu@hotmail.com> wrote in message
    news:bgc1a1$l7t2k$1@ID-117651.news.uni-berlin.de...
    > Ron Vecchi <vencenzo@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]
    >
    >

    Steve C. Orr, MCSD Guest

  6. #5

    Default Re: ASCX as Header/Footer

    Steve C. Orr, MCSD <Steve@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]


    Peter Wu Guest

  7. #6

    Default Re: ASCX as Header/Footer

    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 [url]http://islandclub.us[/url]

    HTH


    "Peter Wu" <peterwu@hotmail.com> wrote in message
    news:bgbvl5$n8ima$1@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]
    >
    >

    Seaside Guest

  8. #7

    Default Re: ASCX as Header/Footer

    Steve C. Orr, MCSD <Steve@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]


    Peter Wu Guest

  9. #8

    Default ASCX as Header/Footer

    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. 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]
    >
    >
    >.
    >
    Michael Guest

  10. #9

    Default ASCX as Header/Footer

    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. 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]
    >
    >
    >.
    >
    Rory Guest

  11. #10

    Default Re: ASCX as Header/Footer

    Rory <rory@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]


    Peter Wu Guest

  12. #11

    Default Re: ASCX as Header/Footer

    Steve C. Orr, MCSD <Steve@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]


    Peter Wu Guest

  13. #12

    Default Re: ASCX as Header/Footer

    this is because you are using absolute positioning in the input control


    "Peter Wu" <peterwu@hotmail.com> wrote in message
    news:bgc2qm$n2780$1@ID-117651.news.uni-berlin.de...
    > Steve C. Orr, MCSD <Steve@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]
    >
    >

    gerry Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139