Creating a master web form in c# and .net


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 5 of 5

Thread: Creating a master web form in c# and .net

Hybrid View

  1. #1
    Jsutin Guest

    Creating a master web form in c# and .net


    Just wondering,

    Is there a way to create a master web form that all other web forms in the
    site will use. I'm thinking I could create a header, already created as a
    web control, and put all of my using statements in the code behind page,
    and then all of the other pages could just reference that form, and not have
    to go through the process of knowing which assemblies to reference. Is this
    just wishful thinking, or am I missing an obvious way to do this. The whole
    site is data driven, and I have created some DB assemblies, the header control,
    footer control and others, and it would be great to just let the rest of
    the developers worry about their specific needs per page.

    Let me know.

    Thanks,
    Justin


  2. #2
    Greg Rothlander Guest

    Re: Creating a master web form in c# and .net


    You are probably going to get a lot of different answers to this question
    because there are a lot of issues involved here.

    I asked this exact question to Dan Appleman, Yasser Shohoud, Rockford Lhotka,
    and Michael Amundsen at VSLive in San Franciso. If you recognize these guys
    then you will know that they are at the top of .Net development.

    Each of them gave me almost completely different answers and none of them
    really fit what I was looking for. Michael Amundsen gave be the best answer
    and suggusted that I look at one of the IBuySky sites that loads each page
    as a seperate UserControl into a single ASPX page. I didn't like the idea
    of building me complete web application in usercontrols so I started playing
    around with templates that used a Header, footer, and menu control.

    This worked the best but it is not perfect because you still end up have
    50 web pages that all have to be maintained individually. If you change
    something like the position of the header, or the width of the menu, etc...
    You will have to go back into each page to make the changes. Then something
    will not match between a few pages because you've got something wrong like
    different cellpaddings are something. So now the user will see the header,footer,
    or menu jump a little between each page. You can spend a lot of time trying
    to figure out what's the difference.

    The advantage is that you can build a template.aspx page that has the basic
    layout and uses each of your header, footer, and menu/navigation controls.
    Then you can tell each of your developers to start with this template.aspx
    page to develop each of the individual web pages. A template is nothing
    more than a page that you create once and copy as a starting point for each
    of the new pages. You could do this in notepad if you wanted.

    Another thing I use is to create a single point of entry page with the header,
    menu, and footer controls loaded via user controls. Then you can place an
    IFRAME in the page that will hold the page details. You can adjust the IFRAME
    to be completely transparent to the user. Then your menu/navigation control
    can load individual ASPX pages into the IFRAME.

    The major problem with this is trying to resize the IFRAME when the pages
    you load are larger than the IFRAME. You can set a vertical scroll bar on
    the IFRAME but it doesn't feel right for many types of web pages.

    You will find that this will work best for certain types of applications
    or parts of your application but it will not work of others.

    Think about these and let me know what you are doing and I can give you some
    additional information. I have descided to use the template method.

    Best Regards,
    Greg Rothlander



    "Jsutin" <jlaw@collectoronline.com> wrote:
    >
    >Just wondering,
    >
    >Is there a way to create a master web form that all other web forms in the
    >site will use. I'm thinking I could create a header, already created as

    a
    >web control, and put all of my using statements in the code behind page,
    >and then all of the other pages could just reference that form, and not

    have
    >to go through the process of knowing which assemblies to reference. Is this
    >just wishful thinking, or am I missing an obvious way to do this. The whole
    >site is data driven, and I have created some DB assemblies, the header control,
    >footer control and others, and it would be great to just let the rest of
    >the developers worry about their specific needs per page.
    >
    >Let me know.
    >
    >Thanks,
    >Justin
    >



  3. #3
    Matthew Solnit Guest

    Re: Creating a master web form in c# and .net

    "Greg Rothlander" <grothlander@austin400.com> wrote in message
    news:3d133bbf$1@10.1.10.29...
    > If you change
    > something like the position of the header, or the width of the menu,

    etc...
    > You will have to go back into each page to make the changes. Then

    something
    > will not match between a few pages because you've got something wrong like
    > different cellpaddings are something. So now the user will see the

    header,footer,
    > or menu jump a little between each page.


    You can solve a lot of these problems using CSS. Using a single
    configuration for layout allows you to centralize everything, so that you
    don't have to change it in each file.



  4. #4
    Tom Guest

    Re: Creating a master web form in c# and .net


    Greg:

    Does your IFRAME and user controls for menu items idea lend itself to better
    flexibility to dynamically change. My desire is to build a management tool
    to store menu choices in SQL db so I don't have to manage it so intensly.
    Am I dreaming?

    Thanks

    TP

    "Greg Rothlander" <grothlander@austin400.com> wrote:
    >
    >You are probably going to get a lot of different answers to this question
    >because there are a lot of issues involved here.
    >
    >I asked this exact question to Dan Appleman, Yasser Shohoud, Rockford Lhotka,
    >and Michael Amundsen at VSLive in San Franciso. If you recognize these

    guys
    >then you will know that they are at the top of .Net development.
    >
    >Each of them gave me almost completely different answers and none of them
    >really fit what I was looking for. Michael Amundsen gave be the best answer
    >and suggusted that I look at one of the IBuySky sites that loads each page
    >as a seperate UserControl into a single ASPX page. I didn't like the idea
    >of building me complete web application in usercontrols so I started playing
    >around with templates that used a Header, footer, and menu control.
    >
    >This worked the best but it is not perfect because you still end up have
    >50 web pages that all have to be maintained individually. If you change
    >something like the position of the header, or the width of the menu, etc...
    > You will have to go back into each page to make the changes. Then something
    >will not match between a few pages because you've got something wrong like
    >different cellpaddings are something. So now the user will see the header,footer,
    >or menu jump a little between each page. You can spend a lot of time trying
    >to figure out what's the difference.
    >
    >The advantage is that you can build a template.aspx page that has the basic
    >layout and uses each of your header, footer, and menu/navigation controls.
    > Then you can tell each of your developers to start with this template.aspx
    >page to develop each of the individual web pages. A template is nothing
    >more than a page that you create once and copy as a starting point for each
    >of the new pages. You could do this in notepad if you wanted.
    >
    >Another thing I use is to create a single point of entry page with the header,
    >menu, and footer controls loaded via user controls. Then you can place

    an
    >IFRAME in the page that will hold the page details. You can adjust the

    IFRAME
    >to be completely transparent to the user. Then your menu/navigation control
    >can load individual ASPX pages into the IFRAME.
    >
    >The major problem with this is trying to resize the IFRAME when the pages
    >you load are larger than the IFRAME. You can set a vertical scroll bar

    on
    >the IFRAME but it doesn't feel right for many types of web pages.
    >
    >You will find that this will work best for certain types of applications
    >or parts of your application but it will not work of others.
    >
    >Think about these and let me know what you are doing and I can give you

    some
    >additional information. I have descided to use the template method.
    >
    >Best Regards,
    >Greg Rothlander
    >
    >
    >
    >"Jsutin" <jlaw@collectoronline.com> wrote:
    >>
    >>Just wondering,
    >>
    >>Is there a way to create a master web form that all other web forms in

    the
    >>site will use. I'm thinking I could create a header, already created as

    >a
    >>web control, and put all of my using statements in the code behind page,
    >>and then all of the other pages could just reference that form, and not

    >have
    >>to go through the process of knowing which assemblies to reference. Is

    this
    >>just wishful thinking, or am I missing an obvious way to do this. The whole
    >>site is data driven, and I have created some DB assemblies, the header

    control,
    >>footer control and others, and it would be great to just let the rest of
    >>the developers worry about their specific needs per page.
    >>
    >>Let me know.
    >>
    >>Thanks,
    >>Justin
    >>

    >



  5. #5
    Greg Rothlander Guest

    Re: Creating a master web form in c# and .net


    The IFRAME and user controls are very dynamic except that the height of the
    IFRAME can be obnoxious if you want it to dynamically grow with the page.
    The menu control that I've built is completely dynamic and could easily
    be built via XML. I'm not doing that on my control because I would have
    to manually build the XML but I could easily set up a db file to load the
    values from. So in short the answer to your question should be yes.

    Give me a better picture of what you are doing and I can answer your question.
    I'm not completely sure what you are trying to do. I think I had the wrong
    idea based on your original POST and now it looks like you are trying to
    do something a little different.

    It seems like you are trying to build your menu choice dynamically based
    on data coming out of SQL or you are you trying to a build a tool that builds
    your menu controls?

    I'm not sure if this is related to what you are doing but I've built menu
    controls based purely on report XML data coming back from the database.
    I used the report category name for a high level tree node and the report
    name for the child tree node. Based on the node selected I used the XML
    to dynamic generate the report. This same idea could be used to generate
    a menu dynamically and then load the report without have to return to the
    server.

    I've also built a menuing system that is generated dynamically based on a
    db file and user permissions and licensing. This way I can lock out users
    that have not purchased particular options and I can add forms or reports
    dynamically to the application when someone purchases them.

    I'm really not sure what you are trying to do so none of this may have any
    relevance. Give me a little more detail and I can offer some suggestions.









    "Tom" <tperkins@ihsaa.org> wrote:
    >
    >Greg:
    >
    >Does your IFRAME and user controls for menu items idea lend itself to better
    >flexibility to dynamically change. My desire is to build a management tool
    >to store menu choices in SQL db so I don't have to manage it so intensly.
    > Am I dreaming?
    >
    >Thanks
    >
    >TP
    >
    >"Greg Rothlander" <grothlander@austin400.com> wrote:
    >>
    >>You are probably going to get a lot of different answers to this question
    >>because there are a lot of issues involved here.
    >>
    >>I asked this exact question to Dan Appleman, Yasser Shohoud, Rockford Lhotka,
    >>and Michael Amundsen at VSLive in San Franciso. If you recognize these

    >guys
    >>then you will know that they are at the top of .Net development.
    >>
    >>Each of them gave me almost completely different answers and none of them
    >>really fit what I was looking for. Michael Amundsen gave be the best answer
    >>and suggusted that I look at one of the IBuySky sites that loads each page
    >>as a seperate UserControl into a single ASPX page. I didn't like the idea
    >>of building me complete web application in usercontrols so I started playing
    >>around with templates that used a Header, footer, and menu control.
    >>
    >>This worked the best but it is not perfect because you still end up have
    >>50 web pages that all have to be maintained individually. If you change
    >>something like the position of the header, or the width of the menu, etc...
    >> You will have to go back into each page to make the changes. Then something
    >>will not match between a few pages because you've got something wrong like
    >>different cellpaddings are something. So now the user will see the header,footer,
    >>or menu jump a little between each page. You can spend a lot of time trying
    >>to figure out what's the difference.
    >>
    >>The advantage is that you can build a template.aspx page that has the basic
    >>layout and uses each of your header, footer, and menu/navigation controls.
    >> Then you can tell each of your developers to start with this template.aspx
    >>page to develop each of the individual web pages. A template is nothing
    >>more than a page that you create once and copy as a starting point for

    each
    >>of the new pages. You could do this in notepad if you wanted.
    >>
    >>Another thing I use is to create a single point of entry page with the

    header,
    >>menu, and footer controls loaded via user controls. Then you can place

    >an
    >>IFRAME in the page that will hold the page details. You can adjust the

    >IFRAME
    >>to be completely transparent to the user. Then your menu/navigation control
    >>can load individual ASPX pages into the IFRAME.
    >>
    >>The major problem with this is trying to resize the IFRAME when the pages
    >>you load are larger than the IFRAME. You can set a vertical scroll bar

    >on
    >>the IFRAME but it doesn't feel right for many types of web pages.
    >>
    >>You will find that this will work best for certain types of applications
    >>or parts of your application but it will not work of others.
    >>
    >>Think about these and let me know what you are doing and I can give you

    >some
    >>additional information. I have descided to use the template method.
    >>
    >>Best Regards,
    >>Greg Rothlander
    >>
    >>
    >>
    >>"Jsutin" <jlaw@collectoronline.com> wrote:
    >>>
    >>>Just wondering,
    >>>
    >>>Is there a way to create a master web form that all other web forms in

    >the
    >>>site will use. I'm thinking I could create a header, already created as

    >>a
    >>>web control, and put all of my using statements in the code behind page,
    >>>and then all of the other pages could just reference that form, and not

    >>have
    >>>to go through the process of knowing which assemblies to reference. Is

    >this
    >>>just wishful thinking, or am I missing an obvious way to do this. The

    whole
    >>>site is data driven, and I have created some DB assemblies, the header

    >control,
    >>>footer control and others, and it would be great to just let the rest

    of
    >>>the developers worry about their specific needs per page.
    >>>
    >>>Let me know.
    >>>
    >>>Thanks,
    >>>Justin
    >>>

    >>

    >



Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center