We know html provides Table tag to form the row and column of data. The table is also used to layout the html elements in a formatted way. Asp 4.0 provides a control called Table and using this we can create tables without using the Tr and Td tags. The Table Control contains one or more TableRow Control and a TableRow Control can have one or more TableCell Controls. ASP.Net derived all these controls from the WebControl class. In this lab, we will create a Table Control and generate row and columns of data. Note, ASP.Net do not remember the content of table control between web requests. The data should be persisted, or one should use sessions. We will learn about session and DB in the later Lab
ASP is called Active Server Pages. ASP 4.0 suits well with Visual Studio 2010. You can read lgacy articles with ASP 2.0 and Visual Studio 2005.
ASP 4.0 RadioButton Control allows you to pick one of many values. Radio buttons are a group of controls. For example, if there are 4 radio buttons, a user can keep only one radio button in a checked state within a group. If there are two groups, the user can keep two buttons in checked state. Means, one button in each group can be in a selected state. In this Lab, we will create a Radio Button group and mention which one is in checked state.
In the previous Lab, Submit Button Control | Lab #006 we learned how to use submit button and handle its click event. In this lab, we will use three Command Buttons and use Command Event to handle the button click. ASP 4.0 supports grouping the buttons and wiring it to a single event handling routine. We can assign a text string to the CommandText property. Command Event handling routine receives the argument CommandEventArgs and we can enquire the CommandText property on this object to know the event producer and take relevant action. Now, we will proceed with the Lab.
When you drop a button control on the ASP.Net Web Form, by default it will act as a Submit Button Control. The submit button performs Auto Postback of the Web Form to the web server. This means, when user clicks the button, the browser will send the Form’s data to the web server. Web Server will process the information and replies back to the web browser. This process is called Postback. In this Lab, we will create a web form with a button control and text field and see how button click works & performs Postback.
Like Asp.Net Label Control, you can read and write text to the TextBox Control via the Text Property. At runtime, user can edit the content of the TextBox and hence this control is widely used to get user input. In this hands-on lab, we will add TextBox controls to the Asp.Net Web Form and explore its behaviour.