ASP. NET DropDownList category display
Our Master/Slave reports will list categories in the DropDownList, and display related products in the page's GridView Based on the selected list items. our first task is to display the category in DropDownList. open FilterByDropDownList In the Filtering folder. aspx: drag and drop a DorpDownList control from the Toolbox on this page and set its ID attribute to Categories. click the "Select data source" link on "DropDownList task. the Select data source Wizard starts.
ASP. NET DropDownList: Specifies the data source of the DropDownList control.
Add a data source control and name it CategoriesDataSource. The control will call GetCategories () of the CategoriesBLL class ().
ASP. NET DropDownList: Add a data source control and name it CategoriesDataSource.
ASP. NET DropDownList: select to use the CategoriesBLL class
ASP. NET DropDownList: configure the data source control using the GetCategories () method
After configuring ObjectDataSource, you must specify the data fields to be displayed in the DropDownList and the data fields used as the value of the data item. we specify CategoryName as the column to be displayed and CategoryID as the value field of the data item.
ASP. NET DropDownList: Specify CategoryName as the column to be displayed, and CategoryID as the value of the data item.
In this case, we have a DropDownList control filled with records in the Categories table. Figure 6 shows the work we have done so far in the browser.
ASP. NET DropDownList: DropDownList lists the current category
- ASP. NET 2.0 data Tutorial: Add An aspx page to a site
- ASP. NET 2.0 data Tutorial: Create a master page
- ASP. NET cross-page value passing skills
- ASP. NET 2.0 data Tutorial: add custom encoding to DAL
- ASP. NET 2.0 data Tutorial: completes the data access layer