自动跳转? 
==========
<asp:dropdownlist id=myDLL autopostback=true selectedindexchanged="myDDL_selectedindexchanged" ...protected void myDDL_selectedindexchanged(..
{
Response.Redirect(myDLL.SelectedValue);
}
还有要不要新建数据表?
==========
不明白...

解决方案 »

  1.   

    1.
    <asp:dropdownlist id=myDLL autopostback=true selectedindexchanged="myDDL_selectedindexchanged" ... protected void myDDL_selectedindexchanged(.. 

    Response.Redirect(myDLL.SelectedValue); 

    这种方法是正确的
    2.
    (1)你可以选择直接在dropdownlist里编辑所有的网址
    (2)或者你建一个表存储所有的网址
    然后取出绑定
    (1)好处,节省页面加载速度,提高性能,缺点:就是所谓的“死的”,不能及时的更新
    (2)好处,能够及时更新,可以做一个页面添加删除所以的网址
    缺点:性能差你看看你适合哪个
      

  2.   

    最好建立一个表。如果是固定不变的那就没有必要使用DropDownList控件了,HTML的<select>元素就搞定了。
    而且不要用Response.Redirect(myDLL.SelectedValue);  这种办法。<asp:DropDownList ID="ddlState" runat="server" AppendDataBoundItems="True"
                        DataTextField="LinkName" DataValueField="LinkUrl">
                        <asp:ListItem Selected="True">-- 政府及省直各厅局网站 --</asp:ListItem>
                    </asp:DropDownList>ddlState.DataSource = friendLinkManager.GetLinkList("政府及省直各厅局网站");
                ddlState.DataBind();
                ddlState.Attributes["onChange"] = "javascript:window.open(this.options[this.selectedIndex].value)";利用OnChange客户端事件就可以实现跳转了。
      

  3.   

    能用客户端做的事情,不要用服务端做。可以写个服务器控件来做。如下。你可以添加很多属性让它更加灵活。比如到底是打开新窗口还是在当前窗口本身,或者自动添加某些前缀。等。
        [DefaultProperty("Text")]
        [ToolboxData("<{0}:JumpSelector runat=server></{0}:JumpSelector>")]
        public class JumpSelector : DropDownList
        {
            protected override void OnPreRender(EventArgs e)
            {
                base.OnPreRender(e);
                Page.ClientScript.RegisterClientScriptBlock(GetType(), "go_jump",
    @"<script language=""javascript"">
    function go_jump(oJumpSelector){
        window.open( oJumpSelector.value );    
    }
    </script>");
            }        protected override void AddAttributesToRender(HtmlTextWriter writer)
            {
                base.AddAttributesToRender(writer);
                writer.AddAttribute("onchange", "javascript:go_jump(this);return false;");
            }
        }使用的代码:
          <dft:JumpSelector ID="JumpSelector1" runat="server">
              <asp:ListItem Value="http://www.163.com">网易</asp:ListItem>
              <asp:ListItem Value="http://www.sina.com">新浪</asp:ListItem>
              <asp:ListItem Value="http://www.sohu.com">搜狐</asp:ListItem>
        </dft:JumpSelector>
      

  4.   

    js:onchange.
    .net:autopostback.
    都可以的.表最好新建个,长久打算的话.