Learning Resources
 

Getting a parameter value from a TextBox control


TextBox control displays a text box control for user input. Usage in ASP.NET is as



 

The public property 'Text' gets or sets the text content of the TextBox control.


TextBox Value by JavaScript
Following code will render a TextBox and a Button control.

aspx page code
                      



                           

                               

                           

                           

                               

                               

                           

                       


                                    Getting TextBox Value in JavaScript:

                               


                                   

                               


                                   

                               





Following code is JavaScript function to get value from TextBox control.

JavaScript function
// Get TextBox value

        function GetTextBoxValue(id)

        {

            alert(document.getElementById(id).value);

        }