Login.TitleText Propiedad
Definición
Importante
Parte de la información hace referencia a la versión preliminar del producto, que puede haberse modificado sustancialmente antes de lanzar la versión definitiva. Microsoft no otorga ninguna garantía, explícita o implícita, con respecto a la información proporcionada aquí.
Obtiene o establece el título del Login control.
public:
virtual property System::String ^ TitleText { System::String ^ get(); void set(System::String ^ value); };
public virtual string TitleText { get; set; }
member this.TitleText : string with get, set
Public Overridable Property TitleText As String
Valor de propiedad
Título del Login control. El valor predeterminado es "Login".
Ejemplos
En el ejemplo de código siguiente se establece la TitleText propiedad .
Importante
Este ejemplo contiene un cuadro de texto que acepta la entrada del usuario, que es una amenaza de seguridad potencial. De forma predeterminada, ASP.NET páginas web validan que la entrada del usuario no incluye elementos HTML ni de script. Para obtener más información, consulte Información general sobre vulnerabilidades de seguridad de script.
<%@ 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;
}
</script>
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>ASP.NET Example</title>
</head>
<body>
<form id="form1" runat="server">
<table style="text-align:center; border:1">
<tr>
<td>
Title Text:
</td>
<td>
<asp:TextBox id="newTitle" runat="server">Login</asp:TextBox></td>
<td>
<asp:Button id="change" runat="server" onClick="changeClick" Text="Change"></asp:Button></td>
</tr>
<tr>
<td colspan="3" align="center">
<asp:Login id="Login1" runat="server"
TitleText="Log In Now"
OnLoginError="OnLoginError">
<TitleTextStyle
Font-Bold="True"
ForeColor="#0000C0"
BackColor="#E0E0E0">
</TitleTextStyle>
</asp:Login>
</td>
</tr>
</table>
</form>
</body>
</html>
<%@ Page Language="VB"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<script runat="server">
Sub changeClick(ByVal sender As Object, ByVal e As EventArgs)
Login1.TitleText = newTitle.Text
End Sub
Sub OnLoginError(ByVal sender As Object, ByVal e As EventArgs)
Login1.TitleTextStyle.BackColor = System.Drawing.Color.Red
End Sub
</script>
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>ASP.NET Example</title>
</head>
<body>
<form id="form1" runat="server">
<table style="text-align:center; border:1">
<tr>
<td>
Title Text:
</td>
<td>
<asp:TextBox id="newTitle" runat="server">Login</asp:TextBox></td>
<td>
<asp:Button id="change" runat="server" onClick="changeClick" Text="Change"></asp:Button></td>
</tr>
<tr>
<td colspan="3" align="center">
<asp:Login id="Login1" runat="server"
TitleText="Log In Now"
OnLoginError="OnLoginError">
<TitleTextStyle
Font-Bold="True"
ForeColor="#0000C0"
BackColor="#E0E0E0">
</TitleTextStyle>
</asp:Login>
</td>
</tr>
</table>
</form>
</body>
</html>
Comentarios
La TitleText propiedad especifica el título mostrado en la parte superior del Login control.
El texto predeterminado del control se localiza en función de la configuración regional actual del servidor.
El valor de esta propiedad, cuando se establece, se puede guardar automáticamente en un archivo de recursos mediante una herramienta de diseñador. Para obtener más información, consulte LocalizableAttributeGlobalización y localización.