Implementing ASP.NET Server Side Controls through Code
There are scenarios that you might face where you cannot find out the actual number of server controls that needs to be added to the web page.
Under such circumstances you might need to add the server controls dynamically. The number of controls that are added is determined by some other factor or value that you get when the application is run.
You can create controls dynamically and add it to the web page when required. For this purpose you need to place a placeholder in the page during the design time.
The placeholder is the place where the server controls will be added during runtime. In the code you will determine which type of control is going to be added to the placeholder.
For example if you are going to add a textbox control with value This is dynamically added, to the placeholder placeholderTB, then the code would look like,
Author As New TextBox
You can also add events to these server controls that you created dynamically.
Click Here To Try It FREE for 7 days
| Why should you go for Server Controls | Advantages of using .NET Server Controls | Understanding ASP.NET Server Controls | Creating Web Server Controls | Server Side Controls in ASP.Net | Creating Custom Server Controls | Server Controls in ASP.NET Web Page | Using Html Server Controls in your Web Pages | Understanding Dynamic Server Controls in ASP.NET | Using ASP Server Controls Templates | Developing ASP.NET Server Controls | Setting properties for ASP.NET Custom Server Controls | Implementing ASP.NET Server Side Controls | Creating Professional ASP.NET Server Controls |
Stay Current With the Latest Technology Developments Realted to .NET. Signup for Our Newsletter and Receive New Articles Through Email.