We help IT Professionals succeed at work.

ASP.net listbox - jump to URL

Andy Green
Andy Green asked
on
312 Views
Last Modified: 2008-01-09
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
Comment
Watch Question

Commented:
on what event when someone clicks on a button?

You can get the selectedValue using ListboxName.SelectedValue

eg response.redirect(ListBox1.selectedValue)

Author

Commented:
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
Senior Web Developer
CERTIFIED EXPERT
Commented:
Unlock this solution and get a sample of our free trial.
(No credit card required)
UNLOCK SOLUTION
Dustin HopkinsSenior Web Developer
CERTIFIED EXPERT

Commented:
That is an example for a dropdown, but a listbox should work the same way.

Author

Commented:
Thanks Dusion,

I'd already figure the dropdown / listbox thing.

ANdy
Unlock the solution to this question.
Thanks for using Experts Exchange.

Please provide your email to receive a sample view!

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.