Difference between user control and master page ?

Last post 06-28-2007 9:59 AM by Dave Sussman. 2 replies.

Sort Posts:

  • Difference between user control and master page ?

    06-27-2007, 3:27 PM

    Hi ,

    There is a lot of similarity between user controls and master pages ????

    Please tell me the difference between user controls and master pages??Will evolution of master pages will

    eliminate user controls totally?? where we should use both of them??

    Regards,

     

    Rohit Kochar
    MCP
  • Re: Difference between user control and master page ?

    06-27-2007, 3:55 PM
    • Participant
      1,886 point Participant
    • dt008
    • Member since 06-17-2007, 2:03 PM
    • Athens, Greece
    • Posts 328

    Master Pages are basically for graphical layout. Pages in your site can "inherit" Master Pages (wrong word, but you get the idea) and share a common layout. User Controls are basically for common objects in your web site, or to separate some logic of a web page.

    Both "technologies" are great, each one for its own purposes. User Controls didn't prove themselves too good for graphical layout purposes Smile

    Plese, do not forget to click "Mark as Answer" on the post that helped you. Thanx!

    My blog: Scenes From A Developer Memory
  • Re: Difference between user control and master page ?

    06-28-2007, 9:59 AM
    Answer

    The key is that Master Pages provide the common content that should be applied to all pages in a site; or at least, all pages that use it. For example, it's very common to require a logo, a menu, etc, on all pages, and a master page is ideal for this; you design the master page with these common elements on them and then every page automatically gets this content too.

    A user control is intended for reusable content, wrapping up small bundles of functionality that is to be reused on multiple pages. For example, wrapping a few labels and text boxes (name, address, post code,e tc), which are required on several, but not all pages.

    Dave

Page 1 of 1 (3 items)