473,385 Members | 1,341 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Open a new webpage from a Dropdown List item

Hi,

I'm looking for some help. I would like to know how to launch a new IE
browser window when I select an item from a dropdown list. I know this is
possible I've seen many examples of where people have done it, but I can't
find any information on how.

I'm using VB as my page language. Thanks in advance...

Brian
Nov 18 '05 #1
1 1455
Hi Brian,

Here's one way to do it...

Private Sub DropDownList1_SelectedIndexChanged _
(ByVal sender As System.Object, _
ByVal e As System.EventArgs) _
Handles DropDownList1.SelectedIndexChanged
Page.RegisterStartupScript _
("opnpg", "<script>window.open('" & _
DropDownList1.SelectedItem.Value & _
"','_blank');</script>")

End Sub

<form id="Form1" method="post" runat="server">
<asp:DropDownList id="DropDownList1" runat="server" AutoPostBack="True">
<asp:ListItem
Value="http://msdn.microsoft.com">http://msdn.microsoft.com</asp:ListItem>
<asp:ListItem
Value="http://www.aspalliance.com/kenc">http://www.aspalliance.com/kenc</asp:ListItem>
</asp:DropDownList>
</form>

Does this help?

Ken
Microsoft MVP [ASP.NET]
http://weblogs.asp.net/kencox
"Brian Reaburn" <re***********@colteng.com> wrote in message
news:eu**************@tk2msftngp13.phx.gbl...
Hi,

I'm looking for some help. I would like to know how to launch a new IE
browser window when I select an item from a dropdown list. I know this is
possible I've seen many examples of where people have done it, but I can't
find any information on how.

I'm using VB as my page language. Thanks in advance...

Brian


Nov 18 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Rod Early | last post by:
I need to know when the select element's dropdown list is opened (as when the user clicks on the arrow or does ALT-downarrow from the keyboard). Similarly, I need to known when the dropdown list...
5
by: sifar | last post by:
Hi, This is my first post to this Group. A] I am trying to create a escalation page which will mail an escalation report of a faulty product. Items needed on Page: -----------------------
6
by: San Smith | last post by:
I have a dropdown list box with list of item. When I read the data from database I want to display that value(one of the item in the drop down box) in the dropdown list box. How to do that in a...
5
by: Kris Rockwell | last post by:
Hello (again), I have gotten the dropdown list functionality to work through a few tricks (probably not the most efficient, but it works) but I am not sure how to set the default selected value....
6
by: Mark | last post by:
I have two dropdown lists. Both have autopostback set to true. In both dropdowns, when you select an item from the list, it redirects to the Value property of the dropdown. Nothing fancy. ...
6
by: Jenna Alten | last post by:
I have a datagrid with a template column that contains a dropdown list. I currently fill and display the dropdown list on the page load. This is working correctly. I am NOT using an Edit Column. I...
2
by: Mike Collins | last post by:
I cannot get the correct drop down list value from a drop down I have on my web form. I get the initial value that was loaded in the list. It was asked by someone else what the autopostback was...
4
by: fat | last post by:
I have a drop down combo box that displays a list of customers , and the list is growing.. I would like to click the dropdown arrow and have a List box in a new form open, then i can choose a...
6
by: yasodhai | last post by:
Hi, I used a dropdown control which is binded to a datagrid control. I passed the values to the dropdownlist from the database using a function as follows in the aspx itself. <asp:DropDownList...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.