读书人

在后台怎么在新页面中打开一个超链接啊

发布时间: 2012-12-16 12:02:32 作者: rapoo

在后台如何在新页面中打开一个超链接啊?
我在一个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系统。

读书人网 >asp.net

热点推荐