- C# Tutorials
- Introduction .Net Framework
- Introduction ASP.Net
- Console Application
- C# Namespaces Console Application
- Constructor in C#
- Destructor in C#
- Console Application Example
- Start with Visual Studio
- Adding Web forms in ASP.Net
- Working with Web forms
- Run ASP.Net Website
- Change Browser for Run
- ASP.Net Server Side Control
- Set Properties of Control
- Write C# server side code
- Comment code in c#
- C# Data types
- C# Variable
Set Server controls Properties in ASP.Net
In out last asp.net tutorial we seen how to add server side control on web form in asp.net. Now after adding control on web form we have to set all controls properties and events. Each server side controls have a different types of properties and events.
Setting Server controls Properties in ASP.Net
In this asp.net post we will learn how to set properties to server control. The properties are used to design and identification purpose of controls in asp.net. let’s understand how to set properties to server side control with an example.
Here, we add a button control on web form and set properties of button control.
Button Control -> Right Click -> Properties
Now open visual studio, add new web form and then add button control on web page as shows below figure.
For Open Properties windows :
Select Button Control –> Press F4 Key
Below screen shows the properties of button control, properties are like ID, BackColor, Text, Width, Height etc….
View properties list in alphabetical order ASP.Net
For view the properties list in alphabetical order, click A-Z Symbol at the top of the property screen like below screen.
Change back ground color of button control in ASP.Net
Now, change any property from property list of button control, it will make changes on button control. If we wish to change back ground control of button control, go to BackColor property and select color as you wish.
Select Button -> Properties -> BackColor = Red
Same things done, when we want to change height, width or font color of button control change respective property.
Change Font color of button control in ASP.Net
For font color in asp.net we use ForeColor property to change font color of button control.
Select Button – > Properties ->ForeColor = Yellow