Tutorials
ASP.NET
ASP.NET Web Forms Controls
ASP.NET Hyperlink Controls
ASP.NET Button Controls
ASP.NET List Controls
While populating the ListBox remember that the Text property of the ListBox is the text which will appear inside the it and the value is simple value. Usually we set the value to an integer which maps to some column in the database. Lets see how we can select a simple item in the ListBox control.
The listbox exposes the property of SelectedItem and SelectedValue which can be used to find the selected item or selected value. You can also set the SelectionMode of the ListBox to multiple which allows the user to select multiple items with the ctrl key being pressed while selecting. Here is a small piece of code you can use to find out all the selected items in the listbox.
The foreach loop will iterate the collection and if it finds the selected item it will assign to the string.
| Occurs when the Button control is clicked. | |
| Occurs when the Button control is clicked. | |
| Occurs when the server control binds to a data source. | |
| Occurs when a server control is released from memory, which is the last stage of the server control lifecycle when an ASP.NET page is requested. | |
| Occurs when the server control is initialized, which is the first step in the its lifecycle. | |
| Occurs when the server control is loaded into the Page object. | |
| Occurs when the server control is about to render to its containing Page object. | |
| Occurs when the server control is unloaded from memory. |
Changes Text in the TextBox when the Button is clicked:
Lets make a small application that will change the text in the TextBox when the button is clicked.
First Page: ASP.NET Web Forms Controls
|
Excellent article on Working with Web Forms Controls and C#. I really benefitted with the contents and was amazed to see this kind of extensive explanation on the topic which is quite rare on Net....... Wasiur Rahman |
| good explanation ...thanks |
|
iam new learner of this topic.in my view it is in very useful for selflearning students. the author's way of illustration is appreciable.thanks for your efforts and helping. |
| I express thank you ! |
| :) Excellent article on Working with Web Forms Controls and C#. |
|
i m having 2 forms in c#. Eachone is having a textbox control. i want to retreive data of textbox of form1 to textbox of form2. How do i do that,Can anyone help me? |
|
you can also take a look at this one good article |
| very good easy to learn |
| very effective & usefull |
| Its really very useful for me to gain a lot of knowledge |
| Its really xlent for .net novice people... |
| thank you for your valid information |