Home All Groups Group Topic Archive Search About

Web Part with listbox Textbox and button

Author
2 Feb 2007 4:01 AM
dhmason
I have a user control in a web part that contains an asp TextBox, an asp
Button ('search button') and an asp ListBox. I need to enable the user to do
the following:

1) double-click on an item in the listbox, copy the value of the selected
item into the textbox, and perform the asp button's on-click, (as if they
clicked the button to run C# code-behind), or
2) enter a value into the textbox and click on the button.

The second one is easy, but I cannot seem to figure out how to do the first
one. I can't seem to use javascript to copy the selected item's value to the
textbox because the form is not in the web part (can't use
document.forms[0].mytextbox.value). I know how to have the double-click on
the listbox item call javascript, but don't know how to trigger the c#
code-behind.

Also, all of this includes MS Ajax 1.0 async processing (UpdatePanels,
controls registered as async via ScriptManager). So, I need the double-click
on the listbox item to not submit the whole page.

Ideas?

AddThis Social Bookmark Button