Working with User Controls
User controls offer an easy way to partition and reuse common user interface functionality across your ASP.NET Web applications. Like a Web Forms page, you can author these controls with any text editor, or develop them using code-behind classes. Also, like a Web Forms page, user controls are compiled when first requested and stored in server memory to reduce the response time for subsequent requests. Unlike pages, however, user controls cannot be requested independently; they must be included in a Web Forms page to work.
The mmUserControl class allows you to create ASP.NET user controls that can easily access the parent web form functionality including the ability to register business objects. The BusinessWebPage property of mmUserControl is automatically populated with the parent form if it's based on mmBusinessWebPage. If the parent page is NOT derived from mmBusinessWebPage, the BusinessWebPage property is null at run time.
Creating a User Control based on mmUserControl
To create a Web user control based on mmUserControl, follow these steps:
- In the Solution Explorer, right-click your web project and select Add | New Item... from the shortcut menu.
- In the Add New Item dialog under My Templates, select MM .NET Web User Control. In the Name text box, specify the name you want to give the new user control:

- Click Add to add the new user control to your web project.
- To view the user control in design mode, click the Design tab at the bottom left of the code window:

- A design surface is displayed in the Visual Studio IDE for your new user control. Now you can customize your user control and reference its BusinessWebPage property as needed.
You can also add code to your user control that allows you to reference business objects that have been registered on the parent form (note the reference to the business object namespace).
For example, in C#:
using Acme.OrderSystem.Business; public partial class MyWebUserControl : mmUserControl { private Customer oCustomer; private void Page_Load(object sender, System.EventArgs e) { this.oCustomer = (Customer)this.BusinessWebPage.RegisterBizObj(new Customer()); } }And in VB .NET:
Imports Acme.OrderSystem.Business Partial Class MyWebUserControl Inherits mmUserControl Private oCustomer As Customer Private Sub Page_Load(sender As Object, e As System.EventArgs) Me.oCustomer = CType(Me.BusinessWebPage.RegisterBizObj(New Customer()), Customer) End Sub End Class
© (c) 2026 Oak Leaf Enterprises, Inc., 1996-2026 • Updated: 04/26/18
Comment or report problem with topic
