关于ASP中点击一个Button跳出来一个小窗口的问题

ITman0101 2011-02-18 11:30:15
我只是想在原来的页面上放上一个button
点击此button在原来的界面上跳出来一个asp界面,但是不是将原来的界面覆盖掉
我现在是这样写的 但是一直报错 请大神帮我看一看

代码如下
<asp:Button ID="Button1" runat="server" Text="新增采购" Width="69px" OnClick="window.open('ITconPurchase.aspx','','width=500,height=300')" />
...全文
164 9 打赏 收藏 转发到动态 举报
写回复
用AI写文章
9 条回复
切换为时间正序
请发表友善的回复…
发表回复
wuyq11 2011-02-18
  • 打赏
  • 举报
回复
OnClientClick="window.open('xxx.aspx','_blank')"
OnClientClick=" OpenWindow();return false;"
function OpenWindow()
{}
ITman0101 2011-02-18
  • 打赏
  • 举报
回复
[Quote=引用 3 楼 a274897911 的回复:]
改为showmodaldialog.方法在button后台写.
[/Quote]


哥们 能具体点吗 我是接触asp没多久啊
谢谢啦
打酱油的 2011-02-18
  • 打赏
  • 举报
回复
改为showmodaldialog.方法在button后台写.
ITman0101 2011-02-18
  • 打赏
  • 举报
回复
[Quote=引用 1 楼 wxr0323 的回复:]
打开的时候 要把现在的页面关掉。。。
[/Quote]


不关掉现在的页面啊
只是想在现在的页面上再跳出来一个小框体
子夜__ 2011-02-18
  • 打赏
  • 举报
回复
打开的时候 要把现在的页面关掉。。。

zhujiazhi 2011-02-18
  • 打赏
  • 举报
回复
change onclick to onclientclick

onclientclick="openWindow();"

js

function openWindow()
{
window.open('xxx.aspx');
return false;
}
zhangbz 2011-02-18
  • 打赏
  • 举报
回复

把页面上的onclick事件去掉,这个是后台操作的事件,不是写脚本的地方
<asp:Button ID="Button1" runat="server" Text="新增采购" Width="69px" OnClick="window.open('ITconPurchase.aspx','','width=500,height=300')" />
改为
<asp:Button ID="Button1" runat="server" Text="新增采购" Width="69px" />

后台
protected void page_load()
{
if(!ispostback)
{
button1.attribute.add("onclick","javascript:window.open('ITconPurchase.aspx','','width=500,height=300')");
}
}
hongyahe 2011-02-18
  • 打赏
  • 举报
回复
controlWindow=window.open(loadpos,winname,"toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width=100,height=200,screenX=5,screenY=5");

controlWindow.focus();
windowResize(controlWindow,width,height);
return "cancel";
ITman0101 2011-02-18
  • 打赏
  • 举报
回复
唉 还是不行啊 有没有高手出现啊

111,120

社区成员

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

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

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