O'Reilly logo

Developing Microsoft® .NET Controls with Microsoft Visual Basic® .NET by John Connell

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Building an ASP.NET Page Counter Custom Control

Even the best of us can use a good Web page hit counter now and then. Since there is no built-in page counter control in .NET, it makes sense to build a custom control that will do the job. This compiled control can be licensed and distributed if you like. But best of all, you can just grab it from the Toolbox and drop it onto a form for the home page of each of your applications. As shown in Figure 10-8, the control displays static text in black on white and variable data in yellow on black. Although the display looks like a line of text, it’s really a control, and all of the output is HTML generated using .NET Framework objects.

Figure 10-8. The PageCounter custom control in action

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required