472,127 Members | 1,446 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

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

dropdownlist selectedvalue (url open new window)

36
I would like to open a new window to a url that I have set as the dropdownlist.selectedvalue on the selected index change event. The selectedvalue is the url path and it will open in the existing window. I've tried window.open before the url, but that doesn't work.



protected void DropDownList_SelectedIndexChanged(object sender, EventArgs e)
{
Response.Redirect(this.ddl.SelectedValue);
}
Mar 29 '07 #1
1 4645
try onchange in the select option
<select name="somevalue" id="somevalue" onchange="newpage(this);">

in javascript:
newpage(page)
{
var x=document.getelementbyid("somevalue");
window.open('page.ddl.x.item(x.selectedIndex).valu e')
or use this if u want in same window
window.location.replace()
}
Apr 2 '07 #2

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

reply views Thread by Daniel Doyle | last post: by
reply views Thread by leo001 | last post: by

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.