Creating Custom Server Controls in ASP.NET

Creating a compelling Web user interface is hard work. Any time you can take advantage of .NET features to make your UI elements more reusable, you should take it. User controls offer one options. But, if you really want flexibility and power, you really have to move to custom server controls. Visual Studio .NET doesn't offer a visual interface for creating custom server controls as it does for user controls, but it really isn't that difficult to create them yourself.

In this video, you walk through the process of creating a custom server control. You will dig into an example that displays a die (for use in, say, a Yahtzee game or a craps game). You will see how to define your own properties that appear in the Properties window and how to control the rendering process. After the control is complete, you will see how to create an ASP.NET application that contains your control, and you'll then use the control to create a functional Web page.

This video demystifies the process of creating your own server controls and gives you a strong foundation for building your own user interface masterpieces.

  Click Here to watch the video!  


From the CodeGuru editors: This link is to a Windows media file (.WMV); you must have a program such as Windows Media Player to view it. This is the first video we have posted, so we are not sure yet what performance you will get.

If you do not have have a high-bandwidth connection, you should not try to view this video. If you like this video, please add a comment so we know to consider more in the future!



About the Author

Bill Hatfield

Bill Hatfield is the best-selling author of numerous books for developers, including ASP.NET For Dummies, Active Server Pages For Dummies (on Classic ASP) and Visual InterDev For Dummies. He is also the editor of Visual Studio .NET Developer, a monthly technical journal from Pinnacle. He's an experienced corporate trainer and works in Indianapolis, IN where he also co-founded the local .NET group, the Indianapolis .NET Developers Association.

Comments

  • A very nice start.

    Posted by jkarafin on 11/05/2005 04:53pm

    Thanks so much for the video. I wish you had one that covered an example for the composite controls. I'm now struggling mightily with a composite user control, because I can't get it to retain-and-render the contents of component list boxes. I don't know if trying a customer control will simplify my life or make it even more complicated! (By the way, positioning a user control isn't as easy as you made it sound. I ended up positioning a panel within the aspx, then adding the user control to the panel.) I swear - I'd pay real money for videos like yours that addressed issues I have.

    Reply
  • Please Send me the Code

    Posted by sidiqahmed on 07/20/2005 08:23am

    Please Send me the Code

    Reply
Leave a Comment
  • Your email address will not be published. All fields are required.

Top White Papers and Webcasts

  • Hurricane Sandy was one of the most destructive natural disasters that the United States has ever experienced. Read this success story to learn how Datto protected its partners and their customers with proactive business continuity planning, heroic employee efforts, and the right mix of technology and support. With storm surges over 12 feet, winds that exceeded 90 mph, and a diameter spanning more than 900 miles, Sandy resulted in power outages to approximately 7.5 million people, and caused an estimated $50 …

  • Live Event Date: April 22, 2014 @ 1:00 p.m. ET / 10:00 a.m. PT Database professionals — whether developers or DBAs — can often save valuable time by learning to get the most from their new or existing productivity tools. Whether you're responsible for managing database projects, performing database health checks and reporting, analyzing code, or measuring software engineering metrics, it's likely you're not taking advantage of some of the lesser-known features of Toad from Dell. Attend this live …

Most Popular Programming Stories

More for Developers

Latest Developer Headlines

RSS Feeds