How to use Button CommandName Property programmatically in asp.net

1.File-> New-> Website->  ASP.NET Web Site(Visual C#) -> Ok

(Now You will see a Default.aspx page. To create your own page->click on dropdown list below Edit->click Add new item->Select Web Form->click Add)

2.ToolBox->Drag and Drop  Button on design window->Right click on Button->select properties->(look for text property) change text property from Button to Next Button->Set CommandName Property to next













ToolBox->Drag and Drop  Button on design window->Right click on Button->select properties->change text property from Button to Back Button->Set CommandName Property to back

3.Right click on Button1(Next Button)->select properties->click Events->Double click on Command Event(to get the code behind)








And write this code

4.Right click on Button2(Back Button)->select properties->click Events->On Command event select Button1_Command from DropDownList(it is the event which we created in our button1 Command event)


5.Click F5 to run your project

































































How to Set or Change Button BackGroundColor(BackColor) Programmatically in asp.net

1.File-> New-> Website->  ASP.NET Web Site(Visual C#) -> Ok

(Now You will see a Default.aspx page. To create your own page->click on dropdown list below Edit->click Add new item->Select Web Form->click Add)

2.Click ToolBox-> Double Click on Button(or drag and drop Button on Design view)->Right click on Button->Select Properties->change Button Text Property to "The Example Button"

3.ToolBox->Drag and Drop Two Button on design window->Right click on Button one->select properties->(look for text property) change text property from Button to   BackColor Coral
->Also change Button two Text property to  BackColor Gold
Your Design Window should look like this 
asp.net Button BackgroundColor(BackColor) Example















4.Double click on Button2(BackColor Coral Button) to get the code behind->Write this code
5.Double click on Button3(backColor Gold Button) to get the code behind->Write this code
6.Click F5 to run your project.  




























 

How to Enable or Disable Button Control Programmatically in asp.net

1.File-> New-> Website->  ASP.NET Web Site(Visual C#) -> Ok

(Now You will see a Default.aspx page. To create your own page->click on dropdown list below Edit->click Add new item->Select Web Form->click Add)

2.Click ToolBox-> Double Click on Button(or drag and drop Button on Design view)->Right click on Button->Select Properties->change Button Text Property to "The Example Button"







ToolBox->Double Click on Label->Right click on Label->Select Properties->On Label Text Property Remove Label(Keep it blank)






3.ToolBox->Drag and Drop Two Button on design window->Right click on Button one->select properties->(look for text property) change text property from Button to   Disable Button
->Also change Button two Text property to  Enable Button
Your Design Window should look like this 
asp.net Enable or Disable Button Example









4.Double click on Button1(Hide Button) to get the code behind->Write this code
5.Double click on Button1(Show Button) to get the code behind->Write this code
6.Click F5 to run your project. 
asp.net Enable or Disable Button Example













asp.net Enable or Disable Button Example













asp.net Enable or Disable Button Example
 

How to Show or Hide Button Programmatically in asp.net

1.File-> New-> Website->  ASP.NET Web Site(Visual C#) -> Ok

(Now You will see a Default.aspx page. To create your own page->click on dropdown list below Edit->click Add new item->Select Web Form->click Add)

2.Click ToolBox-> Double Click on Button(or drag and drop Button on Design view)->Right click on Button->Select Properties->change Button Text Property to "The Example Button"

3.ToolBox->Drag and Drop Two Button on design window->Right click on Button one->select properties->(look for text property) change text property from Button to   Hide Button
->Also change Button two Text property to  Show Button
Your Design Window should look like this 
asp.net Button Show or Hide Example








4.Double click on Button1(Hide Button) to get the code behind->Write this code
5.Double click on Button1(Show Button) to get the code behind->Write this code
6.Click F5 to run your project.  
asp.net Button Show or Hide Example
























asp.net Button Show or Hide Example


























asp.net Button Show or Hide Example

How to Set or Change LinkButton Control Text Programmatically in Asp.Net

1.File-> New-> Website->  ASP.NET Web Site(Visual C#) -> Ok

(Now You will see a Default.aspx page. To create your own page->click on dropdown list below Edit->click Add new item->Select Web Form->click Add)

2.Click ToolBox-> Double Click on LinkButton(or drag and drop LinkButton on Design view)->Right click on LinkButton->Select Properties->change LinkButton Text Property to "This LinkButton Text will Change when Button Click"

3.ToolBox->Drag and Drop Two Button on design window->Right click on Button one->select properties->(look for text property) change text property from Button to   LinkButton Text Sign In
->Also change Button two Text property to  LinkButton Text Sign Out
Your Design Window should look like this 
LinkButton Text Changing Programmatically in asp.net










4.Double click on Button1(LinkButton Text Sign In Button) to get the code behind->Write this code
5.Double click on Button2(LinkButton Text Sign Out Button) to get the code behind->Write this code
6.Click F5 to run your project.
LinkButton Text Changing Programmatically in asp.net










LinkButton Text Changing Programmatically in asp.net














LinkButton Text Changing Programmatically in asp.net

How to Enable or Disable LinkButton Control in Asp.Net

1.File-> New-> Website->  ASP.NET Web Site(Visual C#) -> Ok

(Now You will see a Default.aspx page. To create your own page->click on dropdown list below Edit->click Add new item->Select Web Form->click Add)

2.Click ToolBox-> Double Click on LinkButton(or drag and drop LinkButton on Design view)->Right click on LinkButton->Select Properties->change LinkButton Text Property to "This LinkButton will Disable when Button Click"


3.ToolBox->Drag and Drop Two Button on design window->Right click on Button one->select properties->(look for text property) change text property from Button to  Enable LinkButton
->Also change Button two Text property to  Disable LinkButton
Your Design Window should look like this 
asp.net LinkButton Enable or Disable Example














4.Double click on Button1(Enable LinkButton Button) to get the code behind->Write this code
5.Double click on Button2(Disable LinkButton Button) to get the code behind->Write this code
6.Click F5 to run your project.
asp.net LinkButton Enable or Disable Example
  










asp.net LinkButton Enable or Disable Example














asp.net LinkButton Enable or Disable Example
 

How to Show or Hide LinkButton Control in Asp.Net

1.File-> New-> Website->  ASP.NET Web Site(Visual C#) -> Ok

(Now You will see a Default.aspx page. To create your own page->click on dropdown list below Edit->click Add new item->Select Web Form->click Add)

2.Click ToolBox-> Double Click on LinkButton(or drag and drop LinkButton on Design view)->Right click on LinkButton->Select Properties->change LinkButton Text Property to "This LinkButton will hide when Button Click"


3.ToolBox->Drag and Drop Two Button on design window->Right click on Button one->select properties->(look for text property) change text property from Button to  Hide LinkButton
->Also change Button two Text property to  Show LinkButton
Your Design Window should look like this 
asp.net LinkButton Control Show or Hide Example







4.Double click on Button1(Hide LinkButton Button) to get the code behind->Write this code
5.Double click on Button2(Show LinkButton Button) to get the code behind->Write this code
6.Click F5 to run your project.
asp.net LinkButton Hide or Show Example
    










asp.net LinkButton Hide or Show Example











asp.net LinkButton Hide or Show Example
 

How to Set or Change Label Control Border Width Programmatically in asp.net

1.File-> New-> Website->  ASP.NET Web Site(Visual C#) -> Ok

(Now You will see a Default.aspx page. To create your own page->click on dropdown list below Edit->click Add new item->Select Web Form->click Add)


2.ToolBox-> Drag and Drop a Label to Design window->Right click on label->select properties->(look for text property) change text property from label to Label Control Border Width Set or Change Example

3.ToolBox->Drag and Drop Two Button on design window->Right click on Button one->select properties->(look for text property) change text property from Button to  Border Width 2
->Also change Button two Text property to  Border Width 4
Your Design Window should look like this 
Set Label Border width






4.Double click on Button1(Border Width 2 Button) to get the code behind->Write this code
5.Double click on Button1(Border Width 4 Button) to get the code behind->Write this code
6.Click F5 to run your project.
Set label Border Width programmatically











Set label Border Width programmatically












Set label Border Width programmatically
 

How to Set or Change Label Text ForeColor(Font Color) Programmatically in asp.net

1.File-> New-> Website->  ASP.NET Web Site(Visual C#) -> Ok

(Now You will see a Default.aspx page. To create your own page->click on dropdown list below Edit->click Add new item->Select Web Form->click Add)


2.ToolBox-> Drag and Drop a Label to Design window->Right click on label->select properties->(look for text property) change text property from label to This Label ForeColor(Font Color) will change when clicking the Button.

3.ToolBox->Drag and Drop Two Button on design window->Right click on Button one->select properties->(look for text property) change text property from Button to  ForeColor BlueViolet
->Also change Button two Text property to  ForeColor DarkOrange
Your Design Window should look like this 
Label Forecolor(Text,Font Color) Set or Change Programmatically







4.Double click on Button1(ForeColor BlueViolet Button) to get the code behind->Write this code
5. Double click on Button2(ForeColor DarkOrange Button) to get the code behind->Write this code
 6.Click F5 to run your project.
Label ForeColor(Text,Font) Set or Change Programmatically








Label ForeColor(Text,Font) Set or Change Programmatically










Label ForeColor(Text,Font) Set or Change Programmatically
 

How to Show or Hide Label programmatically in asp.net

1.File-> New-> Website->  ASP.NET Web Site(Visual C#) -> Ok

(Now You will see a Default.aspx page. To create your own page->click on dropdown list below Edit->click Add new item->Select Web Form->click Add)


2.From ToolBox Drag and Drop a Label to Design window->Right click on label->select properties->(look for text property) change text property from label to This Label will Hide when Button Click

3.ToolBox->Drag and Drop Two Button on design window->Right click on Button one->select properties->(look for text property) change text property from Button to  Hide Label
->Also change Button two Text property to  Show Label
Your Design Window should look like this 
Show or Hide Label














4.Double click on Button1(Height50 Button) to get the code behind->Write this code
5. Double click on Button2(Height100 Button) to get the code behind->Write this code
6.Click F5 to run your project.
Label Hide or Show Programmatically
  




Label Hide or Show Programmatically











Label Hide or Show Programmatically
 

How to set or Change Label Control Height Programmatically in asp.net

1.File-> New-> Website->  ASP.NET Web Site(Visual C#) -> Ok

(Now You will see a Default.aspx page. To create your own page->click on dropdown list below Edit->click Add new item->Select Web Form->click Add)


2.From ToolBox Drag and Drop a Label to Design window->Right click on label->select properties->(look for text property) change text property from label to Label Height Changing Example ->also set BackClor property to #6699FF(so that height change will be visible clearly)


3.ToolBox->Drag and Drop Two Button on design window->Right click on Button one->select properties->(look for text property) change text property from Button to Height 50
->Also change Button two Text property to Height 100
Your Design Window should look like this 
Label Height Changing Example














4.Double click on Button1(Height50 Button) to get the code behind->Write this code
5. Double click on Button2(Height100 Button) to get the code behind->Write this code
6.Click F5 to run your project.
Label Height Changing programmatically









Label Height Changing programmatically









How to set or Change Label Control Width Programmatically in asp.net

1.File-> New-> Website->  ASP.NET Web Site(Visual C#) -> Ok

(Now You will see a Default.aspx page. To create your own page->click on dropdown list below Edit->click Add new item->Select Web Form->click Add)


2.From ToolBox Drag and Drop a Label to Design window->Right click on label->select properties->(look for text property) change text property from label to Label Width Changing Example 


3.ToolBox->Drag and Drop Two Button on design window->Right click on Button one->select properties->(look for text property) change text property from Button to Width 100
->Also change Button two Text property to Width 300 
Your Design Window should look like this 
Label Width Changing Programmatically Design window








4.Double click on Button1(Width100 Button) to get the code behind->Write this code
5. Double click on Button2(Width300 Button) to get the code behind->Write this code
6.Click F5 to run your project
Label Width Changing Example















Label Width Changing Example





















How to use ToolTip in Label Control in asp.net

1.File-> New-> Website->  ASP.NET Web Site(Visual C#) -> Ok

(Now You will see a Default.aspx page. To create your own page->click on dropdown list below Edit->click Add new item->Select Web Form->click Add)


2.From ToolBox Drag and Drop a Label to Design window->Right click on label->select properties->(look for text property) change text property from label to Label Control ToolTip Example->Set ToolTip property to   ToolTip on Label Control
ToolTip in Label Control







ToolBox->Drag and Drop a Label to Design window->Right click on label->select properties->(look for text property) change text property from label to This is a ToolTip Example->Set ToolTip property to  
 ToolTip Example two

3.Click F5 to run Your project
ToolTip property on label control










ToolTip property on label control