Compartir por


Page.Theme Propiedad

Definición

Obtiene o establece el nombre del tema de página.

public:
 virtual property System::String ^ Theme { System::String ^ get(); void set(System::String ^ value); };
[System.ComponentModel.Browsable(false)]
public virtual string Theme { get; set; }
[<System.ComponentModel.Browsable(false)>]
member this.Theme : string with get, set
Public Overridable Property Theme As String

Valor de propiedad

Nombre del tema de la página.

Atributos

Excepciones

Se intentó establecer Theme después de que se haya producido el PreInit evento.

Theme se establece en un nombre de tema no válido.

Ejemplos

En el ejemplo de código siguiente se establece la Theme propiedad en un nombre pasado en la cadena de consulta.

void Page_PreInit(object sender, EventArgs e)
{
  // Get the theme name from a QueryString variable
  string ThemeName;
  ThemeName = Request.QueryString["thename"];
  if (ThemeName != null)
  {
    Page.Theme = ThemeName;
  }
}
Public Sub Page_PreInit(ByVal Sender As Object, ByVal e As EventArgs)
      
  ' Get the theme name from a QueryString variable
  Dim ThemeName As String
  ThemeName = Request.QueryString("thename")
  If ThemeName <> Nothing Then
    Page.Theme = ThemeName
  End If
End Sub

Comentarios

La Theme propiedad establece el nombre del tema usado para la página. Si desea que la configuración de la página tenga prioridad sobre la configuración del tema, use la StyleSheetTheme propiedad . Para obtener más información, consulte temas y máscaras de ASP.NET.

La Theme propiedad debe establecerse antes del PreInit evento; si se establece la Theme propiedad después del PreInit evento, se producirá una InvalidOperationException excepción.

El tema especificado debe existir como una aplicación o un tema global. Si el tema no existe, se produce una HttpException excepción.

Se aplica a

Consulte también