Change textbox on a VB listbox 'onclick' event
===

I am currently trying to update a textbox using an 'onclick' event inside a listbox.

Basically, when setting the 'onclick' event attribute, I need to pass the selected listbox value.  However, the issue that is happening is when everything is being built for the very first time, there is no selected value, so it tries to pass a null and errors out.

Some code...

    //listbox attribute creation...
    Me.listbox.Attributes("onclick") = "javascript:board_click_button('" & Me.listbox.SelectedItem.Text & "');"

If I set the SelectedValue to a specific index then every time the user clicks, regardless of what they select, the hardcoded index value is what is always returned.

Is there a way to get 'onclick' to do what I need it it?  I didn't post any further code since I didn't think it would help, but I can if its needed.  Thanks.