How to Bind a TextBox at Runtime
The Microsoft .NET "TextBox" control lets you bind data to the text box during "runtime." Runtime is a programming term that explains when the value of a control is set. Runtime is during the execution of the application where "design time" indicates that the data is set during the development of the app. You set up the TextBox control's value in the Web app's "OnLoad" event which is a function triggered when the user opens a Web page.
Instructions
-
-
1
Open Visual Studio from the Windows "Start" menu in the ".NET Framework" program group. Open your Web app to load all of your website pages.
-
2
Double-click the page you want to use to bind a TextBox value. Locate the "OnLoad" function which is usually at the top of the code page. You place your TextBox code within this function.
-
-
3
Add the following code to bind the value for the text box:
textbox1.Text = "Value";
Replace "Value" with the value you want to bind to the text box. Replace "textbox1" with the name of your own TextBox control in the Web page.
-
1