Freigeben über


HtmlInputHidden-Konstruktor

Initialisiert eine neue Instanz der HtmlInputHidden-Klasse.

Namespace: System.Web.UI.HtmlControls
Assembly: System.Web (in system.web.dll)

Syntax

'Declaration
Public Sub New
'Usage
Dim instance As New HtmlInputHidden
public HtmlInputHidden ()
public:
HtmlInputHidden ()
public HtmlInputHidden ()
public function HtmlInputHidden ()

Hinweise

Mit diesem Konstruktor können Sie eine neue Instanz der HtmlInputHidden-Klasse erstellen und initialisieren.

In der folgenden Tabelle ist der anfängliche Eigenschaftenwert für eine Instanz von HtmlInputHidden aufgeführt.

Eigenschaft

Anfangswert

Type

Das Zeichenfolgenliteral "hidden".

Beispiel

Im folgenden Codebeispiel wird das Erstellen einer neuen Instanz des HtmlInputHidden-Steuerelements und das Platzieren auf der Webseite veranschaulicht.

<%@ Page Language="VB" AutoEventWireup="True" %>

<html>
   <script runat="server" >
  
      Sub Page_Load(sender As Object, e As EventArgs)

         ' Create a new HtmlInputHidden control.
         Dim hidden As HtmlInputHidden = New HtmlInputHidden()
         hidden.ID = "HiddenValue"
         hidden.Value = "Hidden Text"

         ' Add the control to the Controls collection of the
         ' PlaceHolder control.
         Place.Controls.Add(hidden)

         ' Display the value of the HtmlInputHidden control.
         Message.InnerHtml = _
            "This page contains an HtmlInputHidden control that contains " & _
            "the value """ & _
            (CType(Place.FindControl("HiddenValue"), HtmlInputHidden)).Value _
            & """"
        
      End Sub
  
   </script>
  
<body>

   <form runat="server">
  
      <h3> HtmlInputHidden Constructor Example </h3> 
  
      <asp:PlaceHolder id="Place" runat="server"/>
   
      <h5>
         <span id="Message"  
               runat="server">

         </span>
      </h5>
  
   </form>

</body>
</html>
 
<%@ Page Language="C#" AutoEventWireup="True" %>

<html>
   <script runat="server" >
  
      void Page_Load(Object sender, EventArgs e)
      {
         // Create a new HtmlInputHidden control.
         HtmlInputHidden hidden = new HtmlInputHidden();
         hidden.ID = "HiddenValue";
         hidden.Value = "Hidden Text";

         // Add the control to the Controls collection of the
         // PlaceHolder control.
         Place.Controls.Add(hidden);

         // Display the value of the HtmlInputHidden control.
         Message.InnerHtml = 
            "This page contains an HtmlInputHidden control that contains " +
            "the value \"" + 
            ((HtmlInputHidden)Place.FindControl("HiddenValue")).Value + "\"";
        
      }
  
   </script>
  
<body>

   <form runat="server">
  
      <h3> HtmlInputHidden Constructor Example </h3> 
  
      <asp:PlaceHolder id="Place" runat="server"/>
   
      <h5>
         <span id="Message"  
               runat="server">

         </span>
      </h5>
  
   </form>

</body>
</html>
 

Plattformen

Windows 98, Windows 2000 SP4, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

.NET Framework unterstützt nicht alle Versionen sämtlicher Plattformen. Eine Liste der unterstützten Versionen finden Sie unter Systemanforderungen.

Versionsinformationen

.NET Framework

Unterstützt in: 2.0, 1.1, 1.0

Siehe auch

Referenz

HtmlInputHidden-Klasse
HtmlInputHidden-Member
System.Web.UI.HtmlControls-Namespace

Weitere Ressourcen

HTML-Serversteuerelemente