Securing Web Forms

To specify that a form requires the user to log in, set its RequiresSecurity property to true. Note that this property only exists on Web forms that are subclassed from the MM .NET mmBaseWebPage or mmBusinessWebPage classes. This property must be set on form initialization, so you can simply add an override to your form's OnInit() method.

In C#:

protected override void OnInit(EventArgs e)
{
	this.RequiresSecurity = true;
	base.OnInit(e);
}

And in VB .NET:

Protected Overrides Sub OnInit(ByVal e As System.EventArgs)
    Me.RequiresSecurity = True
    MyBase.OnInit(e)
End Sub


Note: If you have not set an MM .NET Web Form's RequiresSecurity property to true, but there are controls that have been marked as "secure" (See Step 10 - Assigning Control IDs to Secure Controls), the user is NOT automatically redirected to the login form.


© (c) 2026 Oak Leaf Enterprises, Inc., 1996-2026 • Updated: 08/01/11
Comment or report problem with topic