OnClick Event in A Select Dropdown Menu (ASP)

Is it possible to have an onClick event fired off when something is selected from a Select dropdown list in ASP?  Similar to how a button when clicked performs an action I would like when an item is selected from a dropdown list that it immediately opens a new page.  This way it does not require the user to select the item from the drop down, then hit a submit button.

this is what I used for one of my buttons.
<input type="button" value="Refresh" onClick="location.href='<%= Me.NewURL.ToString() %>';">

Is there a way to use this method for a dropdown?  Something like
<input type="dropdown" value="Refresh" onClick="location.href='<%= Me.NewURL.ToString() %>';">
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.


You can simply do something like:

<asp:DropDownList ID="ddl" runat="server" OnSelectedIndexChanged="ddl_OnSelectedIndexChanged">
    <asp:ListItem .../>

And in code behind:

Protected Sub ddl_OnSelectedIndexChanged(ByVal sender As Object, ByVal e As EventArgs) Handles ddl.SelectedIndexChanged
End Sub


I think this is what you need if you're using classic ASP.  You can change _top to _blank if you want a new browser window.

<form action="../">
<select onchange="window.open(this.options[this.selectedIndex].value,'_top')">
    <option value="">Choose a destination...</option>
    <option value="http://www.yahoo.com/">YAHOO</option>
    <option value="http://www.google.com/">GOOGLE</option>
    <option value="http://www.altavista.com/">ALTAVISTA</option>
    <option value="http://www.amazon.com/">AMAZON</option>
    <option value="http://artlung.com/">ARTLUNG</option>


Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
rknealAuthor Commented:
Shank - What you have does work but I get a prompt when I click an item from the drop down.  The prompt says

"Javascript: A script has requested that a new URL be loaded.  Do you wish to load http://XXX.XX"

This happens on a blackberry browser.  If I click Yes, it opens the page but if I can get fix this prompt then that would be all I need.  Any ideas?
rknealAuthor Commented:
Works to accomplish what I want but I have to find out a way around an annoying prompt.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Programming Languages-Other

From novice to tech pro — start learning today.