请问用window.location.href='xxxx.aspx'怎么打开新窗口?

ch02645 2005-09-30 10:10:24
我在DataGrid里面想点击行弹出内容怎么做

public void dg_ItemCreated(object sender, System.Web.UI.WebControls.DataGridItemEventArgs e)
{
if(e.Item.ItemIndex!=-1)
{
//链接

e.Item.Attributes.Add("onclick","window.location.href='msinfo.aspx?leib="+Request["leib"].ToString()+"&id="+DataGrid1.DataKeys[(int)e.Item.ItemIndex]+"'");
//原色和变色
e.Item.Attributes.Add("onmouseover","this.setAttribute('BKC',this.style.backgroundColor);this.style.cursor='hand',this.style.backgroundColor='#dddddd'");
e.Item.Attributes.Add("onmouseout","this.style.backgroundColor=this.getAttribute('BKC');");
}
}

以上代码全都可以实现链接,但不是打天新窗口
小弟想让它打开新窗口要加什么属性?
...全文
9453 7 打赏 收藏 转发到动态 举报
写回复
用AI写文章
7 条回复
切换为时间正序
请发表友善的回复…
发表回复
ch02645 2005-09-30
  • 打赏
  • 举报
回复
小弟用window.open 解决了!谢谢大侠提醒!
祝你国庆玩好点
小弟第一次来提问
问题就可以解决?
而且很快
谢谢CSDN
谢谢大家
国庆Happy
wuyi8808 2005-09-30
  • 打赏
  • 举报
回复
试试 window.location.target='_blank'
ch02645 2005-09-30
  • 打赏
  • 举报
回复
Response.Redirect("");
也是用于跳转的吧?
ch02645 2005-09-30
  • 打赏
  • 举报
回复
噢!问题已解决!
小弟对window.open
的一些参数了解得不够!惭愧!
谢谢大侠!
xv84 2005-09-30
  • 打赏
  • 举报
回复
用Response.Redirect("");
ch02645 2005-09-30
  • 打赏
  • 举报
回复
大哥!请帮一下忙!
window.open
是可以!但没有菜单之类的
请问用window.location.href
可以实现打开新窗口吗?
pupo 2005-09-30
  • 打赏
  • 举报
回复
用 window.open

110,539

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 C#
社区管理员
  • C#
  • Web++
  • by_封爱
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

让您成为最强悍的C#开发者

试试用AI创作助手写篇文章吧