Setting Basic ASP.NET Server Control Properties



The server controls found in ASP.NET are specialized server-side objects unique to the ASP.NET development environment which offer a method of adding elements to a web page which have enhanced functionality. To customize the way in which a given server control will function, you specify its properties, the attributes which the control possess. Some properties are unique to a given type of control. However, there are also a number of properties which are common to all server controls.

To set the properties of a given control, simply right-click the control and choose Properties from the context menu. Alternatively, if the Properties window is already visible, simply highlight the control to displays its properties.

Each control has "ID" property which allows you to add a unique name to each element. This ties in with the "id" attribute assigned to HTML elements but is also used by server-side code as a way of referring to the element. All server controls must have an ID, so a default ID is assigned to a control as soon as it is created. Whilst it is possible to be lazy and leave these default IDs in place, it makes much more sense to give each control a descriptive name which matches its role within the context of that page. Many developers like to add further clarity to the name of a control by using a short prefix denoting its type; for example, "txt..." for TextBox controls and "lbl... " for label controls.

The Properties window is divided into different sections. Those properties located in the "Appearance" section of the Properties window determine how the control looks. It contains such properties as the "BackColor" and "ForeColor" as well as the sub-category "Font". The "Font" sub-category allows you to set the font, size and style of the text within a control. The text property determines the text which is displayed on the control. With some control, like the TextBox control, the text property is normally left blank. With other controls, such as labels and buttons, the text property is essential and will need to be changed from its default value.

The TabIndex property is used to specify the order in which elements are activated when using the Tab key to navigate the page. To use this feature, simply assign a number to the TabIndex for each element on the page. Controls with a low TabIndex number will be accessed before those with a higher TabIndex.





About Author:
If you would like to learn more about ASP.NET training courses, visit Macresource Computer Training, a UK IT training company offering ASP.NET training courses in London and throughout the UK.





All Best Articles at http://www.allbestarticles.com
You Can Link Directly to "Setting Basic ASP.NET Server Control Properties"
by using the url: http://www.allbestarticles.com//computer/software/setting-basic-asp.net-server-control-properties.html


Add Your Picture
Add Your Picture


Article Submitted By: Jude Wilson
This Article Has Been Read 105 Times











Publish/Share this article

Remember: The article body, title, author bio and links may not be changed or removed. By publishing this article, you agree to all the terms in our Terms of Service.
Get the HTML for reprinting the article to your site


Rating: Not yet rated




Related information on Software

Save Time and Energy With The Best Malware Software Available

Current scenario in IT job market

Customer Relationship Management

Freight Management Solution

Best Rules of Software Development process

Web and Mobile Technology in Shipping and Logistic Industry

Check out the latest Windows 8 News

Time Attendance Recording Systems – Increase in Productivity

Protect Your Data with Disk Image Software

Why Biometric Technologies are catching the eyes of security equipment manufacturers?

Why a Small Company Should Go For IT Outsourcing

Software Quality Assurance

High End Security Solutions - Biometric Access Control

Voice Biometrics Solutions Against Fraud

Voice Recognition Technology