Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 Development Tools
 ASP.NET
 How to set drop down list to null

Author  Topic 

adya
Starting Member

31 Posts

Posted - 2009-01-02 : 10:15:49
Hi,

I have a page, which has 2 drop down list - Branch and Carrier.

The Carrier list is only populated once the branch is selected. I also want to make the carrier list equal to null, when the user changes the selected branch.

I am using the following code:

ddlBranch_SelectedIndexChanged()
{
//some code

//code for setting the Carrier drop down to null
ddlCarrier.DataSource = null;
ddlCarrier.DataBind();
}

rclabso
Starting Member

1 Post

Posted - 2009-01-04 : 02:56:31
you just try this object command

ddlBranch.Clear() -- Set the ddl to null

i hope it helps.

Go to Top of Page
   

- Advertisement -