Web Forms: Localizing Page Captions

By default, a Web Form's caption is a hard-coded string that cannot be localized (a form's caption appears in the title bar of your web browser). To make this caption localizable, do the following:

  1. Make sure your Web Form is subclassed from an MM .NET web form class such as mmBaseWebPage or mmBusinessWebPage

  2. Open the web form in design mode, and click the HTML button at the bottom left of the IDE. This displays the form in HTML mode.

  3. Towards the top of the form, locate the <title> tag. For example:

    <title>WebForm1</title>

    Change this tag to the following:

    <title id="PageCaption" runat="server"></title>

  4. Right-click the form and select View Code from the shortcut menu. This displays the form's associated code-behind file.

  5. In the form's Page_Load method, add the following code, replacing the "WebForm1" text with the title of your web form:

    In C#:

    this.PageCaption.InnerText = this.GetMessage("WebForm1");

    And in VB .NET:

    Me.PageCaption.InnerText = Me.GetMessage("WebForm1")

  6. Run the application and localize the form as described in the topic Web Forms: Localizing Applications. You should see your form's caption in the list of Localizable text.

Now when you run the application and navigate to this form it displays a localized page caption for the current language.


© (c) 2026 Oak Leaf Enterprises, Inc., 1996-2026 • Updated: 07/05/04
Comment or report problem with topic