nixor:
I mean that the code worked for me. What are we doing different?
This is what I did with no problems:
aspx file:
<asp:DropDownList id="DropDownList1" runat="server" AutoPostBack="True" OnSelectedIndexChanged="DropDownList1_SelectedIndexChanged">
<asp:listitem value="">Select one</asp:listitem>
<asp:listitem value="Si">Si</asp:listitem>
<asp:listitem value="Richiamare">Richiamare</asp:listitem>
<asp:listitem value="NN">Non interessato</asp:listitem>
</asp:DropDownList>
aspx.cs file:
protected void DropDownList1_SelectedIndexChanged(object sender, EventArgs e)
{
if ( DropDownList1.SelectedValue == "Richiamare" )
{
int IDOwner = 123;
ClientScriptManager clientScriptManager = Page.ClientScript;
string javaScript =
"window.open('AgendaPopup.aspx?IDOwner=" + IDOwner.ToString() + "','Dettaglio','width=500,height=500, menubar=no, scrollbars=yes, resizable=yes');";
javaScript = "<script type=text/javascript>" + javaScript + "</script>";
clientScriptManager.RegisterStartupScript(this.GetType(), "openPopup", javaScript) ;
}
}
Of course, if you are using AJAX (I don't see why if you're setting AutoPostBack on the control) you would need to replace the ClientScriptManager object with a ScriptManager object.
NC...