Using master page to use repeatative controls

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • lipsa
    New Member
    • Aug 2006
    • 35

    Using master page to use repeatative controls

    Dear all,
    very new to asp.net 2.0.need help urgently.
    suppose i have 3 pages.
    page1-
    textboxname
    textboxage
    textboxAddress

    page2-

    textboxname
    btnSubmit
    textboxage
    textboxAddress

    page 3-

    textboxname
    textboxage
    textboxAddress
    labelgreetings

    so u can see,in all the 3 pages i hv 3 common fields textboxname,tex tboxage
    textboxAddress. so my ques is can i first create a master page having those 3 common controls and can use it for 3 content pages.is master page only for look/feel or i can use it 4 this purpose also.i need some of the common fields 2 b disabled in content pages.and my content page's controls will be inserted in between master page's control.

    in real scenario,i hv arnd 15 fields common.plz suggest me the right way 2 do it...waiting
    Lipsa
  • r035198x
    MVP
    • Sep 2006
    • 13225

    #2
    Originally posted by lipsa
    Dear all,
    very new to asp.net 2.0.need help urgently.
    suppose i have 3 pages.
    page1-
    textboxname
    textboxage
    textboxAddress

    page2-

    textboxname
    btnSubmit
    textboxage
    textboxAddress

    page 3-

    textboxname
    textboxage
    textboxAddress
    labelgreetings

    so u can see,in all the 3 pages i hv 3 common fields textboxname,tex tboxage
    textboxAddress. so my ques is can i first create a master page having those 3 common controls and can use it for 3 content pages.is master page only for look/feel or i can use it 4 this purpose also.i need some of the common fields 2 b disabled in content pages.and my content page's controls will be inserted in between master page's control.

    in real scenario,i hv arnd 15 fields common.plz suggest me the right way 2 do it...waiting
    Lipsa
    Do not post questions in the Articles section.


    Moved to the forum.

    Comment

    • Frinavale
      Recognized Expert Expert
      • Oct 2006
      • 9749

      #3
      Hi Lipsa,

      I would recommend creating a user control to collect this information.
      For instance if you had to collect Name,Address,Ci ty... for a dealer and then Name,Address,Ci ty for the dealer's customers I'd suggest creating 1 WebUserControl "ContactInforma tionControl" that holds this information.

      A web user control is much like a regular object except that it has the graphical side as well. You can give it public properties and pull the information out of the control in any page...all you have to do is drag it onto the page that you want it to be on...and you can create as many of them as you'd like too!

      Treat them as you would treat any aspx page. :)

      Hope this helps you

      -Frinny

      Comment

      • nmsreddi
        Contributor
        • Jul 2006
        • 366

        #4
        Hello

        Master page can solve your problem but it is not exactly solution for your problem ,the best way is to use webusercontrol ,which you candrag and drop where ever required ,Master page is used when you want to display some logos or any site headings or any menus which can be shown on most of the pages ,

        Controls can also be placed on master but it is quite risky process while accessing those controls in your content pages later in your application.bet ter user webusercontrols which solves your problem

        Comment

        • lipsa
          New Member
          • Aug 2006
          • 35

          #5
          Thanks a lot for the response.i am going to use usercontrol instead.
          Lipsa

          Comment

          Working...