TitleText Property

Login.TitleText Property


Gets or sets the title of the Login control.

Namespace:   System.Web.UI.WebControls
Assembly:  System.Web (in System.Web.dll)

public virtual string TitleText { get; set; }

Property Value

Type: System.String

The title of the Login control. The default is "Login".

The TitleText property specifies the title displayed at the top of the Login control.

The default text for the control is localized based on the server's current locale.

The value of this property, when set, can be saved automatically to a resource file by using a designer tool. For more information, see LocalizableAttribute and ASP.NET Globalization and Localization.

The following code example sets the TitleText property.

System_CAPS_security Security Note

This example contains a text box that accepts user input, which is a potential security threat. By default, ASP.NET Web pages validate that user input does not include script or HTML elements. For more information, see Script Exploits Overview.

<%@ Page Language="C#"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<script runat="server">
void changeClick(object sender, EventArgs e)
    Login1.TitleText = newTitle.Text;

void OnLoginError(object sender, EventArgs e)
    Login1.TitleTextStyle.BackColor = System.Drawing.Color.Red;

<html xmlns="http://www.w3.org/1999/xhtml" >
    <head runat="server">
    <title>ASP.NET Example</title>
        <form id="form1" runat="server">
            <table style="text-align:center; border:1">
                        Title Text:
                        <asp:TextBox id="newTitle" runat="server">Login</asp:TextBox></td>
                        <asp:Button id="change" runat="server" onClick="changeClick" Text="Change"></asp:Button></td>
                    <td colspan="3" align="center">
                        <asp:Login id="Login1" runat="server" 
                            TitleText="Log In Now"

.NET Framework
Available since 2.0
Return to top
© 2015 Microsoft