|
code
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Disable databound dropdownlist if 0 itemsI'm working on an ASP.NET 2.0 web page right now (using C#), and am
trying to figure out how I can conditionally disable a drop down linst on the page if the datasource that it is bound to has no items. I tried in the Page_Load event checking how many items are in the list (ddl.Items.Count), but that always returned 0, meaning that it was firing the event before the SqlDataSource that is on the page is returning its list. Any suggestions? Thanks Check the item count after the list has databound.
Protected Sub DropDownList1_DataBound(ByVal sender As Object, ByVal e As System.EventArgs) Handles DropDownList1.DataBound DropDownList1.Enabled = DropDownList1.Items.Count > 0 End Sub
Login control - image button with text over it
how to get selectedvalue of radiobuttonlist in Javascript? looping through formview controls List Box : help preventing duplicate items Accessing USER CONTROL which is inside Masterpage through Another USER Control inside normal page. Use CSS in themes Session sharing between ASP and ASP.NET StyleSheetTheme not working Login HelpPageIconUrl is the help link How to catch Internet Explorer events? |
|||||||||||||||||||||||