Link to home
Create AccountLog in
Avatar of Andy Green
Andy GreenFlag for United Kingdom of Great Britain and Northern Ireland

asked on

ASP.net listbox - jump to URL

Hi Experts

New to ASP.NET2 so forgive a silly question.

I have a listbox control, databound to an underlying class for its data. What I want to do is open  link based on the ID of the item in the list box.

Google dosn't have the answer.

Andy
Avatar of skiltz
skiltz
Flag of New Zealand image

on what event when someone clicks on a button?

You can get the selectedValue using ListboxName.SelectedValue

eg response.redirect(ListBox1.selectedValue)
Avatar of Andy Green

ASKER

Hi

Yes I can capture that event, but how do I then jump to a URL. I guess I can append the selected index to the querystring, or is there another way in ASP.net.

Andy
ASKER CERTIFIED SOLUTION
Avatar of Dustin Hopkins
Dustin Hopkins
Flag of United States of America image

Link to home
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
See answer
That is an example for a dropdown, but a listbox should work the same way.
Thanks Dusion,

I'd already figure the dropdown / listbox thing.

ANdy