Page 156 - DCAP312_WEB_TECHNOLOGIES_II
P. 156

Web Technologies-II



                   Notes                        public String UserName
                                                {
                                                get { return (_UserName);
                                                }
                                                protected override void OnInit(EventArgs e)
                                                {
                                                // WWB: Allow The Base Class To Initialize First
                                                base.OnInit(e);
                                                UserName = Request[ “UserName”].ToString();
                                                this.Load += new System.EventHandler(this.Page_Load);
                                                }
                                                protected void Page_Load(object sender, EventArgs e)
                                                {
                                                ((ParentMasterPage)Master).SetTitle(_UserName);
                                                }
                                                }
                                                MasterPage1.master.cs
                                                public partial class MasterPage1 : ParentMasterPage
                                                protected void Page_Load(object sender, EventArgs e)
                                                {
                                                lblTitle.Text =title;
                                                }
                                                }
                                                The IIS 6.0 uses a new process model called worker process isolation mode,
                                                which is different from the process model used in previous versions of IIS.
                                                ASP.NET uses this process model by default when running on Windows
                                                Server 2003.
                                 8.2 User Control


                                 Server controls are one of the possessions that create developing with ASP.NET so easy and
                                 influential  at  the  similar  time.  We  have  discuss  HTML  and  web  server  controls  and  have
                                 showed you how to use them in your ASP.NET pages, but what if present is not a control that
                                 do exactly what you want to do? Like most all in ASP.NET there is really no magic concerned
                                 with server controls. In fact, you can build your own controls and use them on your pages just
                                 like you use the ones that ship with .NET. Controls that you build are called user controls and
                                 they are the topic of this lesson.

                                 User Control Structure
                                    •  ASP.NET User Controls Overview
                                    •  How to: Convert Web Forms Pages into ASP.NET User Controls
                                    •  How to: Include a User Control in an ASP.NET Web Page
                                    •  How to: Create Instances of ASP.NET User Controls Programmatically
                                    •  How to: Create Templated ASP.NET User Controls
                                    •  How to: Create ASP.NET User Controls
                                    •  How to: Include ASP.NET User Controls in Web Pages
                                    •  Walkthrough: Creating Reusable Elements with ASP.NET User Controls


        150                               LOVELY PROFESSIONAL UNIVERSITY
   151   152   153   154   155   156   157   158   159   160   161