如何用hyperlink控件在点击打开一个新的窗口,同时将某个dropdownlist选中的值也一起传过去。或者有没有别的办法能不刷新页面来取得dropdownlist的值传到另外的一个界面上。谢谢了!问题解决马上给分

解决方案 »

  1.   

    关注....不提交到服务器,hyperlink怎么改变值呢private void Page_Load(object sender, System.EventArgs e)
    {
       HyperLink1.NavigateUrl = "xxx.aspx?key=" + this.DropDownList1.SelectedItem.Value;
    }private void DropDownList1_SelectedIndexChanged(object sender, System.EventArgs e)
    {
       HyperLink1.NavigateUrl = "xxx.aspx?key=" + this.DropDownList1.SelectedItem.Value;
    }
    前提是DropDownList1的AutoPostBack属性为true
      

  2.   

    这个方法我知道的。我就是不想刷新页面啊!能不能用javascript取得dropdownlist的当前选中值??
      

  3.   

    看看这个例子<HTML>
    <HEAD>
    <script language='javascript'>
    function changeImg(imgAdderss)
    {
    var item=document.all("imgForChange");
    item.src=imgAdderss;
    }
    </script>
    </HEAD>
    <body>
    <form runat=server>
    <asp:DropDownList id="ddlStrage" runat="server" onChange="changeImg(ddlStrage.options[selectedIndex].value);"
    Width="114px">
    <asp:ListItem Value="7">7</asp:ListItem>
    <asp:ListItem Value="5">5</asp:ListItem>
    <asp:ListItem Value="4">4</asp:ListItem>
    </asp:DropDownList>
    <IMG name="imgForChange" src="../images/btn_add.gif" border="0">
    </form>
    </body>
    </HTML>
      

  4.   

    http://blog.csdn.net/renyu732/articles/382717.aspx
    应该能找到你的答案.
      

  5.   

    谢谢。我是想得到dropdownlist的当前选定的值
      

  6.   

    将dropdownlist取出的值做为公共变量,然后用带参数的url传递就OK啦!
      

  7.   

    dropdownlist.selectvalue,即是dropdownlist选中的值.
      

  8.   

    <select id="ddlStrage" runat="server" Width="114px">
    <option Value="7">7</option>
    <option Value="2">3</option>
    <option Value="3">2</option>
    <option Value="1">1</option>
    </select>
    <a href=# onclick="window.open('a.htm?id=' + document.all('ddlStrage').value ,'','');return(false);">打开窗口</a>