<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                ??一站式輕松地調用各大LLM模型接口,支持GPT4、智譜、豆包、星火、月之暗面及文生圖、文生視頻 廣告
                # ASP.NET Web Forms - TextBox 控件 TextBox 控件用于創建用戶可輸入文本的文本框。 ## TextBox 控件 TextBox 控件用于創建用戶可輸入文本的文本框。 TextBox 控件的特性和屬性列在我們的 [WebForms 控件參考手冊頁面](aspnet-ref-webcontrols.html)。 下面的實例演示了您可能會用到的 TextBox 控件的一些屬性: ## 實例 ``` <html> <body> <form runat="server"> A basic TextBox: <asp:TextBox id="tb1" runat="server" /> <br /><br /> A password TextBox: <asp:TextBox id="tb2" TextMode="password" runat="server" /> <br /><br /> A TextBox with text: <asp:TextBox id="tb4" Text="Hello World!" runat="server" /> <br /><br /> A multiline TextBox: <asp:TextBox id="tb3" TextMode="multiline" runat="server" /> <br /><br /> A TextBox with height: <asp:TextBox id="tb6" rows="5" TextMode="multiline" runat="server" /> <br /><br /> A TextBox with width: <asp:TextBox id="tb5" columns="30" runat="server" /> </form> </body> </html> ``` [演示實例 ?](/try/showaspx.php?filename=demo_textbox_ex1) ## 添加腳本 當表單被提交時,TextBox 控件的內容和設置可能會被服務器腳本修改。表單可通過點擊一個按鈕或當用戶修改 TextBox 控件的值的時候進行提交。 在下面的實例中,我們在 .aspx 文件中聲明了一個 TextBox 控件、一個 Button 控件和一個 Label 控件。當提交按鈕被觸發時,submit 子例程將被執行。submit 子例程將寫入一行文本到 Label 控件中: ## 實例 ``` <script runat="server"> Sub submit(sender As Object, e As EventArgs) lbl1.Text="Your name is " & txt1.Text End Sub </script> <html> <body> <form runat="server"> Enter your name: <asp:TextBox id="txt1" runat="server" /> <asp:Button OnClick="submit" Text="Submit" runat="server" /> <p><asp:Label id="lbl1" runat="server" /></p> </form> </body> </html> ``` [演示實例 ?](/try/showaspx.php?filename=demo_textbox) 在下面的實例中,我們在 .aspx 文件中聲明了一個 TextBox 控件和一個 Label 控件。當您修改了 TextBox 中的值,并且在 TextBox 外部點擊(或者按下了 Tab 鍵)時,change 子例程將會被執行。change 子例程將寫入一行文本到 Label 控件中: ## 實例 ``` <script runat="server"> Sub change(sender As Object, e As EventArgs) lbl1.Text="You changed text to " & txt1.Text End Sub </script> <html> <body> <form runat="server"> Enter your name: <asp:TextBox id="txt1" runat="server" text="Hello World!" ontextchanged="change" autopostback="true"/> <p><asp:Label id="lbl1" runat="server" /></p> </form> </body> </html> ``` [演示實例 ?](/try/showaspx.php?filename=demo_textbox3)
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看