DropDownList怎么实现网站友情连接的跳转?(asp.net(C#))? 
跳转到另一个页面怎么写代码?

解决方案 »

  1.   

    private void DropDownList1_SelectedIndexChanged(object sender, System.EventArgs e) 

    Response.Write("<script>window.open('*.aspx?id="+this.DropDownList1.SelectValue+"')</script>");//跳转 
      

  2.   

    private void DropDownList1_SelectedIndexChanged(object sender, System.EventArgs e) 

    Response.Redirect("http://www.google.com");

      

  3.   

    刚做了下 这个可以<%@ Page language="c#" Codebehind="WebForm3.aspx.cs" AutoEventWireup="false" Inherits="W.WebForm3" %>
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
    <HTML>
    <HEAD>
    <title>WebForm3</title>
    <meta name="GENERATOR" Content="Microsoft Visual Studio .NET 7.1">
    <meta name="CODE_LANGUAGE" Content="C#">
    <meta name="vs_defaultClientScript" content="JavaScript">
    <meta name="vs_targetSchema" content="http://schemas.microsoft.com/intellisense/ie5">
    </HEAD>
    <body MS_POSITIONING="GridLayout">
    <form id="Form1" method="post" runat="server">
    <asp:DropDownList ID="DropDownList2" runat="server" AutoPostBack="true" Style="Z-INDEX: 100; LEFT: 15px; POSITION: absolute; TOP: 16px">
    <asp:ListItem>--跳转</asp:ListItem>
    <asp:ListItem Value="http://www.163.com">网易</asp:ListItem>
    <asp:ListItem Value="http://www.baidu.com">百度</asp:ListItem>
    </asp:DropDownList>
    </form>
    </body>
    </HTML>
    .cs
    private void DropDownList2_SelectedIndexChanged(object sender, System.EventArgs e)
    {
    Response.Redirect(DropDownList2.SelectedValue); 

    }
      

  4.   

     别忘记设置 AutoPostBack="true"