原问题:http://topic.csdn.net/u/20120222/21/63fda261-02c4-44f2-9b53-79367cddbfc6.html

怎么动态改变链接内容

 

Insus.NET已经在3楼回复了,帖主于6楼回复说,执行不了。
为DropDownList加一个属性AutoPostBack,并设为true。

另外还重构了一下写法:

View Code
protected void DropDownList1_SelectedIndexChanged(object sender, EventArgs e)
    {
        if (DropDownList1.SelectedIndex == -1return;

        HyperlinkBind(DropDownList1.SelectedItem.Text);
    }

    private void HyperlinkBind(string name)
    {
        HyperLink1.Text = name;
        HyperLink1.NavigateUrl = "http://www." + name + ".com";
    }

 

演示:

怎么动态改变链接内容

 

 

相关文章:

  • 2022-12-23
  • 2021-08-31
  • 2022-12-23
  • 2022-12-23
  • 2021-10-19
  • 2021-09-21
  • 2021-08-04
  • 2021-11-15
猜你喜欢
  • 2021-10-21
  • 2022-12-23
  • 2021-06-07
  • 2022-12-23
  • 2022-12-23
  • 2021-12-16
相关资源
相似解决方案