locked
AppendDataBoundItems throws error RRS feed

  • Question

  • User1838126768 posted

    I've got a Dropdownlist with Categories
    I've also got a Listbox with Items filled using the selection from the DDL (autopostback=true).

    I have a SQLDataSource for each one.
    the DDL populates perfectly. the listbox SQL DataSource uses a stored procedure, that, on its own works perfectly.

    It works well just as outlined above. However, when I add the following properties to the DDL, I get an error:
    appendDataBoundItems=true and '--Select--'  (tried 'Select' also) as an item

    the error is:
    Input string was not in a correct format

    I also set up the sqlDataSource selecting event handler, so that it would check for 'Select' first, but it bypasses that handler when debugging, and goes straight to the error msg

    I set web.config to debug=true and set customErrors to Off and that's all I get....

    Any ideas?

    Thursday, January 20, 2011 5:49 PM

Answers

  • User626880745 posted

    what is the Value of the ListItem you've set to "--Select--" ?

    you could try to set it to "", so:

    <asp:ListItem Value="" Text="--Select--"/>



    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, January 20, 2011 6:19 PM

All replies

  • User626880745 posted

    what is the Value of the ListItem you've set to "--Select--" ?

    you could try to set it to "", so:

    <asp:ListItem Value="" Text="--Select--"/>



    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, January 20, 2011 6:19 PM
  • User1838126768 posted

    DOAH!! - - must have been a brain scramble - I knew that - since the values were numeric, I just set the value (which previously had equalled the text)  to zero and it worked like a charm...

    thanks.

    Thursday, January 20, 2011 6:43 PM