473,809 Members | 2,742 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

dropdownlist --> URL

Web form VS 2005...

DropDownList has text describing links and url's.

What I want to do is have the DropDownList1.S electedIndexCha nged event
perform a hyperlink to the Value in the control at the selected index
position.

I've looked high and low for an example of this under ASP.NET 2.0 but have
yet to find any thing close. What VB function do I use in the code behind
page event to trigger the lauch of a new instance of the browser to the url
specified in the index value of the DropDownList control?
Jan 5 '06 #1
2 1278
Ken Carter wrote:
Web form VS 2005...

DropDownList has text describing links and url's.

What I want to do is have the DropDownList1.S electedIndexCha nged event
perform a hyperlink to the Value in the control at the selected index
position.

I've looked high and low for an example of this under ASP.NET 2.0 but have
yet to find any thing close. What VB function do I use in the code behind
page event to trigger the lauch of a new instance of the browser to the url
specified in the index value of the DropDownList control?


I believe you will need to do this in javascript on the client side.
The server can not spawn a new instance of the browser.

chris
Jan 5 '06 #2
Some code to get you going...

Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArg s) Handles MyBase.Load
'Put user code to initialize the page here
If Not Page.IsPostBack Then

Dropdownlist1.A ttributes("onCh ange") = "doJump('" &
Dropdownlist1.C lientID & "');"
End If
End Sub

<script language="javas cript">
<!--

function doJump(theID) {
var theElement = document.getEle mentById(theID) ;
var si = theElement.sele ctedIndex;
if (si > 0) {
theElement.sele ctedIndex = 0; //reset menu to default
window.location .href = theElement.opti ons[si].value;
}
}

-->
</script>

<form id="Form1" method="post" runat="server">
....
<asp:dropdownli st id="Dropdownlis t1" Runat="server"> </asp:dropdownlis t>
....
</form>

Greg

"Chris" <no@spam.com> wrote in message
news:ub******** ******@TK2MSFTN GP12.phx.gbl...
Ken Carter wrote:
Web form VS 2005...

DropDownList has text describing links and url's.

What I want to do is have the DropDownList1.S electedIndexCha nged event
perform a hyperlink to the Value in the control at the selected index
position.

I've looked high and low for an example of this under ASP.NET 2.0 but
have yet to find any thing close. What VB function do I use in the code
behind page event to trigger the lauch of a new instance of the browser
to the url specified in the index value of the DropDownList control?


I believe you will need to do this in javascript on the client side. The
server can not spawn a new instance of the browser.

chris

Jan 5 '06 #3

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

Similar topics

0
1521
by: C | last post by:
Hi, I have a drop down on my aspx as below. In between my opening and closing tags I render out the Items by populating a variable with the items. <asp:DropDownList id="selProf" runat=server> <%=strItems%>
1
954
by: Amit Chandel | last post by:
I'm recompiling a VS2003 project in VS2002 (3rd party code, we still use VS2002 and cannot upgrade at this time). I've managed to reverse engineer all of the code except for the following instance, where I get an error : 'SelectedValue' is not a member of System.Web.UI.WebControls.DropDownList' Is there a way to do this in VS2002 on .NET 1.0 framework? All I see is DropDownList.SelectedItem as an option. Thanks In Advance,
6
13029
by: Chris Fink | last post by:
Does anyone know it is possible to include a small image(.gif .jpeg) within a <SELECT><option> so that the user would see the option text as well as a little image(icon) in the option? I know this is not an ASP.NET related question, but I know this group is knowledgeable and quick with responses. Thanks
2
2155
by: COHENMARVIN | last post by:
I'm leafing through a big book on asp.net, and I don't see any way to the following: 1. bind values and text to a dropdown 2. Also make the first line of the dropdown say something different. For instance, if I'm working with a table of hotels, I might want a 'select' control as follows <select id="mylistbox" runat="server"> <option value="*">Add New Hotel</option> <option value="1">The Hilton</option> <option value="2">The...
5
1854
by: Mark Rae | last post by:
Hi, Has the <asp:DropDownList> - <asp:ListItem> functionality changed in v2? In v1.1, the following works as expected: <asp:DropDownList ID="cmbStatus" Runat=server EnableViewState=False> <asp:ListItem Value=0>&nbsp;</asp:ListItem> <asp:ListItem Value=1>Awaiting</asp:ListItem> <asp:ListItem Value=2>Current</asp:ListItem> <asp:ListItem Value=3>Terminated</asp:ListItem>
2
1463
by: John Smith | last post by:
I have this DataGrid: <asp:datagrid id="dg1" runat="server" AutoGenerateColumns="False"> <Columns> <asp:TemplateColumn HeaderText="SM"> <ItemTemplate> <asp:Label id="Label2" runat="server" Text='<%# Container.DataItem("SM") %>'> </asp:Label> </ItemTemplate>
2
1987
by: John Smith | last post by:
I have this DataGrid: <asp:datagrid id="dg1" runat="server" AutoGenerateColumns="False"> <Columns> <asp:TemplateColumn HeaderText="SM"> <ItemTemplate> <asp:Label id="Label2" runat="server" Text='<%# Container.DataItem("SM") %>'> </asp:Label> </ItemTemplate>
1
5429
by: spamguy | last post by:
I have a DataGrid and a column that changes into a DropDownList when edited: <columns> <asp:templatecolumn headertext="Role Type"> <itemtemplate> <asp:hyperlink id="hlinkRoleType" navigateurl='<%# "contact_roles_details.aspx?id=" + DataBinder.Eval(Container, "DataItem.ID", "{0}").ToString() %>' Text='<%# DataBinder.Eval(Container, "DataItem.Role", "{0}").ToString() %>' runat="server"/> </itemtemplate> <edititemtemplate>...
5
26642
by: nzkks | last post by:
Hi I am using these: ASP.Net 2.0, VB.Net, Visual Studio 2005, SQL Server 2005, Formview controls In a ASP.Net form I have 20 textboxes and 20 dropdownlists(ddl). All ddl(s) are databound and get the data from a single objectdatasource. All textboxes and ddl(s) support null values. Textboxes are for entering numbers and ddl(s) are for selecting the unit (mm, cm, in, m3, oz, qt like these.). I am using the below code to achieve two...
0
9601
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10376
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
10115
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9199
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7660
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5687
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4332
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3861
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3014
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.