No, you can't, but you can easily make the dropdown go to the selected
url (without even having to do another postback). Just add an onchange
event to the dropdown:
theDropdown.Attributes.Add("onchange",
"window.location=this.options[this.selectedIndex].value;");
--
Göran Andersson
_____
http://www.guffa.com
protected void drdn_links_TextChanged(object sender, EventArgs e)
{
this.drdn_links.Attributes.Add("onchange",
"window.location=this.options[this.selectedIndex].value;");
}
--
Paul G
Software engineer.
That's because it's not a server event. I said that it didn't do a postback.
> but did find a TextChanged event. I added the
> code below and set a break point. It does hit the break point but looks like
> it is not going to the page, possibly a bad URL or should this work?
>
> protected void drdn_links_TextChanged(object sender, EventArgs e)
> {
> this.drdn_links.Attributes.Add("onchange",
> "window.location=this.options[this.selectedIndex].value;");
> }
You should not put the code in an event handler. The code adds a client
event to the control, so if you do it in an event handler, it will work
the second time that you change the dropdown.
Put the code in Page_Load.