在客户端用脚本实现hyperlink的navigateurl 动态变化?
有三个控件,文本控件
<asp:textbox id="TextBox1" style="Z-INDEX: 101; LEFT: 368px; POSITION: absolute; TOP: 136px" runat="server">aaa</asp:textbox>
下拉框
<asp:dropdownlist id="DropDownList1" style="Z-INDEX: 102; LEFT: 272px; POSITION: absolute; TOP: 136px"
runat="server" AutoPostBack="True">
<asp:ListItem Value="1">1</asp:ListItem>
<asp:ListItem Value="2">2</asp:ListItem>
<asp:ListItem Value="3">3</asp:ListItem>
</asp:dropdownlist>
超级链接
<asp:hyperlink id=HyperLink1 style="Z-INDEX: 103; LEFT: 536px; POSITION: absolute; TOP: 136px"
runat="server" NavigateUrl="index.aspx?a=<%=TextBox的值%>&b=<%=下拉框所选择的值%>">HyperLink</asp:hyperlink>

解决方案 »

  1.   

    document.getElementById("[这里注意,asp控件可能有所不同]").NavigateUrl="xxxxxxx";
      

  2.   

    在后台写
    this.HyperLink1.NavigateUrl=="index.aspx?a="+this.TextBox1.text+"&b="+this.DropDownList1.selectedValue;
    这样不行吗?  
      

  3.   

    其实这个需求,用html标签<a herf="[url]">yyyy</a>就可以搞定拉
      

  4.   

    lz已经说了:
    在客户端用脚本实现hyperlink的navigateurl 动态变化。
      

  5.   

    在客户端用脚本实现hyperlink的navigateurl 动态变化:        function test() {
                var a1 = document.getElementById("TextBox1").value;
                var drop   =   document.getElementById("DropDownList1");
                var b1 = drop.options[drop.selectedIndex].value;
                document.getElementById("HyperLink1").href = index.aspx.aspx?a="+a1+"&b="+b1;
            }
    所要注意的是index.aspx路径