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