Accessing listbox info from javascript

N

Nevyn Twyll

I've got an asp.net page with C# code-behind.
On the page, I have a multi-select listbox. The listbox can't do roundtrips
as the use selects and deselects items.

I want to have a hyperlink (or button /etc.) that pops up a NEW WINDOW with
the IDs of the selected items in the listbox as parameters.
I know I could use the code-behind to get all this info and use
Response.Redirect() to do it in the same window, but it needs to be a popup.

I have a Javascript function:

<script language="javascript">
function showCriteria(sRedirect)
{
window.open(sRedirect,"_blank", "height=300, width=450, left=100,
top=100, " + "location=no, menubar=no, resizable=no, " + "scrollbars=no,
titlebar=no, toolbar=no", true);
}
</script>

that can launch the new window.
It looks like what I really need to do is access the listbox & its info in
the Javascript. Either that, or somehow use something on the server side in
the round-trip to cause this code to get execute on the user's side.

The only thing I can think of righ tnow, is to have a button that calls a
code-behind function to set a hyperlink to contain all the right information
from the listbox, and THEN have the user press that hyperlink.

And that's just way too lame.

Help?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top