日期:2014-05-17  浏览次数:20353 次

在后台如何在新页面中打开一个超链接啊?
我在一个DropDownList的DataFileValue上绑定了网址,通过点击按钮在新页面中打开DropDownList上绑定的网址。这个功能如何实现啊?
------最佳解决方案--------------------
Response.Write("<script>window.open.....</script>")或
Page.ClientScript.RegisterClientScriptBlock(this,this.GetType(),"js","window.open.....",true)
试试
------其他解决方案--------------------
引用:
人家问的是在新页面打开,那些Response.Redirect的就算了吧

你的意思是window.open?
------其他解决方案--------------------
点击按钮 获取值。this.Dropdownlist.SelectValue;

Response.Redirect("值")
------其他解决方案--------------------

public void Button1_Click(object sender,EventArgs e)
{
    string url = this.DropDownList1.SelectedItem.Text.Trim();
    Response.Redirect(url);
}

------其他解决方案--------------------
人家问的是在新页面打开,那些Response.Redirect的就算了吧
------其他解决方案--------------------
引用:
引用:

人家问的是在新页面打开,那些Response.Redirect的就算了吧

你的意思是window.open?

恩,我是用window.open();实现的。
------其他解决方案--------------------

public void DropDownList1_SelectChange(object sender,EventArgs e)
{
    string url = this.DropDownList1.SelectedValue.Trim();
    Response.Redirect(url);
}

------其他解决方案--------------------
url 要写全,http://www.baidu.com 这种 
------其他解决方案--------------------
我试了用window.open();浏览器会阻止。我用的是win7系统。