下拉框选中某一项后,比如我选中“新建”,怎么弹出新窗体,并把下拉框的名字传给新的窗体?

解决方案 »

  1.   

    那你在下拉事件里new一个Form,然后showdialog出来就可以了啊。
    下拉框的名字传给新窗体 只是变量传递的问题了。
      

  2.   

    下拉框_SelectedIndexChanged  事件showModalDialog() 谈出新窗体 
    windows.open() 也可以。
      

  3.   

    window.open
    window.showmodaldialog
    都可以
      

  4.   


     protected void DropDownList1_SelectedIndexChanged(object sender, EventArgs e)
        {
          if(DropDownList1.SelectedValue.ToString()=="新建")
          {
             Response.Write("<script>window.open('你弹出的窗口.aspx?id='"+DropDownList1.SelectedValue.ToString()+"'','newwindow','height=300,width=500,top='+(screen.AvailHeight-300)/2+',left='+(screen.AvailWidth-300)/2+',toolbar=no,menubar=no,scrollbars=no, resizable=no,location=no, status=no')</script>;")
          }
        }
      

  5.   

    给下拉框添加onchange前台事件
    <asp:DropDownList ID="dd1" runat="server" onchange="showform(this);" Width="100px">
            <asp:ListItem>asdfasdf</asp:ListItem>
        </asp:DropDownList>.js
    function showform(obj)
    {
    var n = obj.selectedIndex; 
    var txt = obj.options[n].text; 
    var value = obj.options[n].value
    if(tx == "新建")
    {
    window.showmodaldialog(url + "?id=" + obj.id);
    }
    }