How to Add a DropDownList to a PlaceHolder Control in asp.net Programmatically using C#

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 PlaceHolder(or drag and drop PlaceHolder on Design view)->

ToolBox-> Double Click on Button->Right click on Button->Select Properties->Change Text Properties to "Add Controls to PlaceHolder"-> Your Design Window should look like this













 3.Double click on Button to get the code behind(or Right click on Button->select Properties->Click Events->Double Click on Click Events)->Now write this code
 4.Click F5 to run your project->OK 















 

No comments:

Post a Comment