this.BtnPersonAdd.Attributes.Add("onclick","<script language=javascript>window.location='../AddPerson.aspx';</script>"); 如果你是框架结构
this.BtnPersonAdd.Attributes.Add("onclick","<script language=javascript>top.location='../AddPerson.aspx';</script>");
this.BtnPersonAdd.Attributes.Add("onclick","<script language=javascript>top.location='../AddPerson.aspx';</script>");
解决方案 »
- 关于cookie的问题
- 用户登录浏览器关闭自动注销
- GridView1调用的值如何加上链接变为导航
- select count()大量数据会不会很耗时?
- 未能在设计视图中打开,在<%...值...%>块中,以不同的方式将值括起来??????
- 小弟初学ASP.NET以前都是做ASP的,现在突然有点摸不着头脑了,大家出出主意,有什么好的办法?
- <pages buffer="true" enableViewStateMac="true" smartNavigation="false" />
- 树形数据绑定Dropdrownlist控件
- 电子教室开发涉及哪些技术?
- 如何简单的在网站各页面判断session
- 高手请进(一个计时计费的问题)
- 初学者的问题
实际的结果就是
<asp:button id="BtnPersonAdd" ... onclick="<script language=...>self..</script>">
一看就知道了
试试
加参数id
this.Btn.Attributes.Add("onclick","window.open('b.aspx?ID="+id+"','_blank');");
-------------------------------------------this.BtnPersonAdd.Attributes.Add("onclick","window.location.href='AddPerson.aspx';");
如果想新打开页面,保留原页面
this.BtnPersonAdd.Attributes.Add("onclick","window.open('AddPerson.aspx');");