Link to home
Create AccountLog in
Avatar of JCWEBHOST
JCWEBHOST

asked on

asp combo box

hey guys i am having problem with clearing a asp combo box.

here is whats happening:

when i excute items.clear() it clear the items in the combo box but i have to click the combo box than the items get clear. if i do not click the text area the item that was selected remains there.

i looked in the internet and found some thing

http://forums.asp.net/t/1434914.aspx 

it works fine for clearing 1 combo box, but i have 2 and more.

here my code:

            ddRegion.Items.Clear();
            Clear(ddRegion);
            ddArea.Items.Clear();
            Clear(ddArea);


    public void Clear(Control ComboBox)
    {
        ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "Script", "function pageLoad() { $find('" + ComboBox.ClientID + "').get_textBoxControl().value = ''; }", true);
    }


i think why it is not clearing the other two is because of the

pageLoad()   cause of the page only loaded once


can any one help me?
ASKER CERTIFIED SOLUTION
Avatar of maatthias
maatthias
Flag of United States of America image

Link to home
membership
Create an account to see this answer
Signing up is free. No credit card required.
Create Account
And you do mean DropDownList control right?  Not combo box.
Avatar of JCWEBHOST
JCWEBHOST

ASKER

combo box
SOLUTION
Link to home
membership
Create an account to see this answer
Signing up is free. No credit card required.
Create Account
that not working
thanks