title: Change textbox on a VB listbox 'onclick' event
body: <p>I am currently trying to update a textbox using an 'onclick' event inside a listbox.</p>
  
  <p>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.</p>
  
  <p>Some code...</p>
  
  <pre><code>//listbox attribute creation...
  Me.listbox.Attributes("onclick") = "javascript:board_click_button('" &amp; Me.listbox.SelectedItem.Text &amp; "');"
  </code></pre>
  
  <p>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.</p>
  
  <p>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.</p>