Web User Control Development Environment: MS Visual Studio .NET 2005 Internet Programming Class 2006 Instructor: Dr. James W. Fawcett TA: Murat K. Gungor IP Class 2006 Web User Control .NET 2005
Web User Control Create New Empty Web Site Name it WebUserControl IP Class 2006 Web User Control .NET 2005
1 Add New Item 2 Web User Control IP Class 2006 Web User Control .NET 2005
We only have LoginControl.ascx Using Toolbox in Design View of LoginControl.ascx Lets add Standard Controls Panel Two TextBox Button Label Then rename controls’ IDs appropriately Renaming IDs LoginNameTextBox PasswordTextBox LoginButton StatusLabel IP Class 2006 Web User Control .NET 2005
We are done with the LoginControl How can we see it working? Change the PasswordTextBox’s TextMode to Password Double Click on Login Button and add LoginButton_Click function Then type the code on the right. We are done with the LoginControl How can we see it working? IP Class 2006 Web User Control .NET 2005
Add New Item Web Form IP Class 2006 Web User Control .NET 2005
Select LoginControl.ascx We have Default.aspx page LoginControl.ascx Drag and Drop Select LoginControl.ascx Then hold the left mouse button down then drag it over Default.aspx and drop it. What happened is we just added these highlighted code lines to Default.aspx IP Class 2006 Web User Control .NET 2005
Lets Run It What else can we do with Web User Control? Search Control Menu Admin Menu Customer Menu Employee Menu News Control Deal of the Day Control Quotes Control What to cook today Control Etc… IP Class 2006 Web User Control .NET 2005
End of Presentation IP Class 2006 Web User Control .NET 2005