User Control definitions

Discussion in 'ASP .Net' started by tshad, Jun 23, 2006.

  1. tshad

    tshad Guest

    User VS 2003, I would like to use User Controls to control the page look
    with 3 User Controls (...PageTop.ascx, ...NavigateTop.ascx and
    PageBottom.ascx). I would put the Content User control between the
    NavigateTop and PageBottom User controls.

    These files be something like: sdhcPageTop.ascx, ft2PageTop.ascx,
    sbPageTop.ascx, macPageTop.ascx etc. I would have the same files for the
    NavigateTop.ascx and PageBottom.asc.

    The ones that load is dependant on who is logging on.

    I have a file that really does nothing but load the controls.

    I have 2 problems I have run into.

    1) I would like to put the <body> tag into the PageTop.ascx file as that
    will change dependant on who logs on. For example, if I am loading the
    "sdhc..." files, I would have a different body tag than if I loaded the
    "ft2..." files.

    The problem is that if the </body> is not in the same .ascx file, I get an
    error saying:

    Unexpected end of file looking for </body> tag.

    So I now have it in my main page.

    Is there a way around this?

    2) The other problem is that I would like to load the 4 different User
    controls dependant on who logs on:

    The file looks something like:

    ******************************************************************************
    <%@ Page Language="VB" trace="false" debug="true" ContentType="text/html"
    ResponseEncoding="iso-8859-1" %>
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">
    <%@ Register TagPrefix="fts" TagName="Logon" Src="../applicant/logon.ascx"
    %>
    <%@ Register TagPrefix="fts" TagName="Top" Src="sdhcPageTop.ascx" %>
    <%@ Register TagPrefix="fts" TagName="Navigate" Src="sdhcNavigateTop.ascx"
    %>
    <%@ Register TagPrefix="fts" TagName="Bottom" Src="sdhcPageBottom.ascx" %>
    <%@ Register TagPrefix="fts" TagName="Top" Src="ft2PageTop.ascx" %>
    <%@ Register TagPrefix="fts" TagName="Navigate" Src="ft2NavigateTop.ascx" %>
    <%@ Register TagPrefix="fts" TagName="Bottom" Src="ft2PageBottom.ascx" %>
    <%@ Register TagPrefix="fts" TagName="Top" Src="sbPageTop.ascx" %>
    <%@ Register TagPrefix="fts" TagName="Navigate" Src="sbNavigateTop.ascx" %>
    <%@ Register TagPrefix="fts" TagName="Bottom" Src="sbPageBottom.ascx" %>
    <html>
    <head>
    <title>:: Staffing Workshop ::</title>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    <body id="myBody" bgcolor="#FFFFFF" text="#000000"
    background="/images/sdhc/sdhcgiwave11.gif" leftmargin="0" topmargin="0"
    marginwidth="0" marginheight="0" link="#006699" vlink="#660033"
    alink="#CC9966" runat="server">
    <form id="addForm" runat="server">
    <fts:Top runat="Server"/>
    <fts:Navigate runat="Server"/>
    <fts:Logon runat="Server"/>
    <fts:Bottom runat="Server"/>
    </form>
    </body>
    </html>
    ********************************************************************************

    I know this won't work, but I am just illustrating what I am trying to
    achieve

    All my pages would look the same except that first Custom Control would be
    different (this is the content control). One for logon, one for searchlist,
    one for adding new people etc.

    How do I handle the loading of the different Controls programmatically and
    do I need to define each file in this page?

    I would like not to have to define each set of 3 controls on each page.
    That would mean that everytime a new user came up, I would have to add 3 new
    controls to each page.

    With include files, it would work fine, but I would like to use User
    Controls instead.

    Thanks,

    Tom
     
    tshad, Jun 23, 2006
    #1
    1. Advertising

  2. I think that you are using the wrong approach for this. I would suggest that
    rather than making a version of each control for each browser, you add code
    in the Controls' Code-Behind files that detects which browser the code is
    being generated for and makes the appropriate adjustments. I think that this
    will simplify things for you, because it will mean fewer files and
    modifications when you add/remove content.
    --
    Nathan Sokalski

    http://www.nathansokalski.com/

    "tshad" <> wrote in message
    news:...
    > User VS 2003, I would like to use User Controls to control the page look
    > with 3 User Controls (...PageTop.ascx, ...NavigateTop.ascx and
    > PageBottom.ascx). I would put the Content User control between the
    > NavigateTop and PageBottom User controls.
    >
    > These files be something like: sdhcPageTop.ascx, ft2PageTop.ascx,
    > sbPageTop.ascx, macPageTop.ascx etc. I would have the same files for the
    > NavigateTop.ascx and PageBottom.asc.
    >
    > The ones that load is dependant on who is logging on.
    >
    > I have a file that really does nothing but load the controls.
    >
    > I have 2 problems I have run into.
    >
    > 1) I would like to put the <body> tag into the PageTop.ascx file as that
    > will change dependant on who logs on. For example, if I am loading the
    > "sdhc..." files, I would have a different body tag than if I loaded the
    > "ft2..." files.
    >
    > The problem is that if the </body> is not in the same .ascx file, I get an
    > error saying:
    >
    > Unexpected end of file looking for </body> tag.
    >
    > So I now have it in my main page.
    >
    > Is there a way around this?
    >
    > 2) The other problem is that I would like to load the 4 different User
    > controls dependant on who logs on:
    >
    > The file looks something like:
    >
    > ******************************************************************************
    > <%@ Page Language="VB" trace="false" debug="true" ContentType="text/html"
    > ResponseEncoding="iso-8859-1" %>
    > <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    > "http://www.w3.org/TR/html4/loose.dtd">
    > <%@ Register TagPrefix="fts" TagName="Logon" Src="../applicant/logon.ascx"
    > %>
    > <%@ Register TagPrefix="fts" TagName="Top" Src="sdhcPageTop.ascx" %>
    > <%@ Register TagPrefix="fts" TagName="Navigate" Src="sdhcNavigateTop.ascx"
    > %>
    > <%@ Register TagPrefix="fts" TagName="Bottom" Src="sdhcPageBottom.ascx" %>
    > <%@ Register TagPrefix="fts" TagName="Top" Src="ft2PageTop.ascx" %>
    > <%@ Register TagPrefix="fts" TagName="Navigate" Src="ft2NavigateTop.ascx"
    > %>
    > <%@ Register TagPrefix="fts" TagName="Bottom" Src="ft2PageBottom.ascx" %>
    > <%@ Register TagPrefix="fts" TagName="Top" Src="sbPageTop.ascx" %>
    > <%@ Register TagPrefix="fts" TagName="Navigate" Src="sbNavigateTop.ascx"
    > %>
    > <%@ Register TagPrefix="fts" TagName="Bottom" Src="sbPageBottom.ascx" %>
    > <html>
    > <head>
    > <title>:: Staffing Workshop ::</title>
    > <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    > <body id="myBody" bgcolor="#FFFFFF" text="#000000"
    > background="/images/sdhc/sdhcgiwave11.gif" leftmargin="0" topmargin="0"
    > marginwidth="0" marginheight="0" link="#006699" vlink="#660033"
    > alink="#CC9966" runat="server">
    > <form id="addForm" runat="server">
    > <fts:Top runat="Server"/>
    > <fts:Navigate runat="Server"/>
    > <fts:Logon runat="Server"/>
    > <fts:Bottom runat="Server"/>
    > </form>
    > </body>
    > </html>
    > ********************************************************************************
    >
    > I know this won't work, but I am just illustrating what I am trying to
    > achieve
    >
    > All my pages would look the same except that first Custom Control would be
    > different (this is the content control). One for logon, one for
    > searchlist, one for adding new people etc.
    >
    > How do I handle the loading of the different Controls programmatically and
    > do I need to define each file in this page?
    >
    > I would like not to have to define each set of 3 controls on each page.
    > That would mean that everytime a new user came up, I would have to add 3
    > new controls to each page.
    >
    > With include files, it would work fine, but I would like to use User
    > Controls instead.
    >
    > Thanks,
    >
    > Tom
    >
     
    Nathan Sokalski, Jun 24, 2006
    #2
    1. Advertising

  3. tshad

    tshad Guest

    I don't understand what the browser has to do with it.

    What this is doing is creating a different look for each company, using
    their graphics some of their buttons etc.

    Most of the page would look like the clients site, except that the bottom
    right would be our stuff.

    In essence the, the top and left would be the clients look and feel and the
    right bottom would be our content. It would be a self contained User
    Control that had all our Textboxes, labels, DataGrids etc.

    This would be similar to what 2005 is doing with it's Master Pages. But I
    need to do it with 2003.

    Thanks,

    Tom

    "Nathan Sokalski" <> wrote in message
    news:...
    >I think that you are using the wrong approach for this. I would suggest
    >that rather than making a version of each control for each browser, you add
    >code in the Controls' Code-Behind files that detects which browser the code
    >is being generated for and makes the appropriate adjustments. I think that
    >this will simplify things for you, because it will mean fewer files and
    >modifications when you add/remove content.
    > --
    > Nathan Sokalski
    >
    > http://www.nathansokalski.com/
    >
    > "tshad" <> wrote in message
    > news:...
    >> User VS 2003, I would like to use User Controls to control the page look
    >> with 3 User Controls (...PageTop.ascx, ...NavigateTop.ascx and
    >> PageBottom.ascx). I would put the Content User control between the
    >> NavigateTop and PageBottom User controls.
    >>
    >> These files be something like: sdhcPageTop.ascx, ft2PageTop.ascx,
    >> sbPageTop.ascx, macPageTop.ascx etc. I would have the same files for the
    >> NavigateTop.ascx and PageBottom.asc.
    >>
    >> The ones that load is dependant on who is logging on.
    >>
    >> I have a file that really does nothing but load the controls.
    >>
    >> I have 2 problems I have run into.
    >>
    >> 1) I would like to put the <body> tag into the PageTop.ascx file as that
    >> will change dependant on who logs on. For example, if I am loading the
    >> "sdhc..." files, I would have a different body tag than if I loaded the
    >> "ft2..." files.
    >>
    >> The problem is that if the </body> is not in the same .ascx file, I get
    >> an error saying:
    >>
    >> Unexpected end of file looking for </body> tag.
    >>
    >> So I now have it in my main page.
    >>
    >> Is there a way around this?
    >>
    >> 2) The other problem is that I would like to load the 4 different User
    >> controls dependant on who logs on:
    >>
    >> The file looks something like:
    >>
    >> ******************************************************************************
    >> <%@ Page Language="VB" trace="false" debug="true" ContentType="text/html"
    >> ResponseEncoding="iso-8859-1" %>
    >> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    >> "http://www.w3.org/TR/html4/loose.dtd">
    >> <%@ Register TagPrefix="fts" TagName="Logon"
    >> Src="../applicant/logon.ascx" %>
    >> <%@ Register TagPrefix="fts" TagName="Top" Src="sdhcPageTop.ascx" %>
    >> <%@ Register TagPrefix="fts" TagName="Navigate"
    >> Src="sdhcNavigateTop.ascx" %>
    >> <%@ Register TagPrefix="fts" TagName="Bottom" Src="sdhcPageBottom.ascx"
    >> %>
    >> <%@ Register TagPrefix="fts" TagName="Top" Src="ft2PageTop.ascx" %>
    >> <%@ Register TagPrefix="fts" TagName="Navigate" Src="ft2NavigateTop.ascx"
    >> %>
    >> <%@ Register TagPrefix="fts" TagName="Bottom" Src="ft2PageBottom.ascx" %>
    >> <%@ Register TagPrefix="fts" TagName="Top" Src="sbPageTop.ascx" %>
    >> <%@ Register TagPrefix="fts" TagName="Navigate" Src="sbNavigateTop.ascx"
    >> %>
    >> <%@ Register TagPrefix="fts" TagName="Bottom" Src="sbPageBottom.ascx" %>
    >> <html>
    >> <head>
    >> <title>:: Staffing Workshop ::</title>
    >> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    >> <body id="myBody" bgcolor="#FFFFFF" text="#000000"
    >> background="/images/sdhc/sdhcgiwave11.gif" leftmargin="0" topmargin="0"
    >> marginwidth="0" marginheight="0" link="#006699" vlink="#660033"
    >> alink="#CC9966" runat="server">
    >> <form id="addForm" runat="server">
    >> <fts:Top runat="Server"/>
    >> <fts:Navigate runat="Server"/>
    >> <fts:Logon runat="Server"/>
    >> <fts:Bottom runat="Server"/>
    >> </form>
    >> </body>
    >> </html>
    >> ********************************************************************************
    >>
    >> I know this won't work, but I am just illustrating what I am trying to
    >> achieve
    >>
    >> All my pages would look the same except that first Custom Control would
    >> be different (this is the content control). One for logon, one for
    >> searchlist, one for adding new people etc.
    >>
    >> How do I handle the loading of the different Controls programmatically
    >> and do I need to define each file in this page?
    >>
    >> I would like not to have to define each set of 3 controls on each page.
    >> That would mean that everytime a new user came up, I would have to add 3
    >> new controls to each page.
    >>
    >> With include files, it would work fine, but I would like to use User
    >> Controls instead.
    >>
    >> Thanks,
    >>
    >> Tom
    >>

    >
    >
     
    tshad, Jun 27, 2006
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Tom Rowton
    Replies:
    2
    Views:
    671
    Tom Rowton
    Aug 1, 2003
  2. Mad Scientist Jr
    Replies:
    0
    Views:
    644
    Mad Scientist Jr
    Mar 22, 2006
  3. John Harrison

    user definitions in the std namespace

    John Harrison, Jul 22, 2004, in forum: C++
    Replies:
    1
    Views:
    396
    John Harrison
    Jul 25, 2004
  4. Jonathan Wood

    User Control to Control Other User Control

    Jonathan Wood, Jan 24, 2010, in forum: ASP .Net
    Replies:
    4
    Views:
    556
    Jonathan Wood
    Feb 2, 2010
  5. peter

    how to control or modify the WSDL's definitions?

    peter, Mar 16, 2010, in forum: ASP .Net Web Services
    Replies:
    0
    Views:
    794
    peter
    Mar 16, 2010
Loading...

Share This Page