Whats up Gonzalo,
If I am understanding your correctly the value for each item in the DropDownList is a URL correct? Something like:
Text Value
United States
www.foo.org
Argentina
www.foo.net
Canada
www.foo.edu
So the selectedItem.Value property of the dropdown is what you want to direct to, correct?
If this is the case, you could do 2 things:
Client Side Javascript
:
Handle the onChange event and have your javascript do something like:
<asp:dropdownlist id="drp" runat="server" onChange="openNewWin(this);"><asp:dropdownlist>
function openNewWin(dropdown)
{
var iIndex = dropdown.selectedIndex;
var sLocation = dropdown.options[iIndex].value;
window.open(sLocation);
return true;
}
Or, set the List to autopost back and do this in its event handler:
string sLocation = Convert.ToString(drp.SelectedItem.Value);
string sJavaScript = "";
sJavaScript = "<script language='javascript'>";
sJavaScript += "window.open(sLocation);";
sJavaScript += "</scr" + "ipt>";
Response.Write(sJavaScript);
hth.
================================================== =========
Read this if you want to know how to get a correct reply for your question:
http://www.catb.org/~esr/faqs/smart-questions.html
^^Took that from planoie's profile^^
^^Modified text taken from gbianchi profile^^
================================================== =========
Technical Editor for:
Professional Search Engine Optimization with ASP.NET
http://www.wiley.com/WileyCDA/WileyT...470131470.html
================================================== =========
Why can't Programmers, program??
http://www.codinghorror.com/blog/archives/000781.html
================================================== =========