怎么在c# 中,在webform1中点击一个button,弹出webform2

u010007789 2015-01-09 07:21:18
怎么在c# 中,在webform1中点击一个button,弹出webform2,在url那里设置只能跳转,不能在webform1存在的情况下弹出webform2

只知道一个 form.show()语句,但是貌似不能用在webform上?
...全文
169 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
SPFarmer 2015-01-10
  • 打赏
  • 举报
回复
楼主是用的APS.NET 还是 Windows form程序? 如果是Windows Form程序,恐怕做不到啊。
eeell_2423891094 2015-01-10
  • 打赏
  • 举报
回复
在Web页面中点击相关按钮弹出新窗口 protected void Page_Load(object sender, EventArgs e) { OpenWebFormSize("Add.aspx", 250, 230, 10, 20); } // 打开指定大小的新窗体 // <param name="url">地址</param> // <param name="width">宽</param> // <param name="heigth">高</param> // <param name="top">头位置</param> // <param name="left">左位置</param> public static void OpenWebFormSize(string url, int width, int heigth, int top, int left) { string js = @"<Script language='JavaScript'>window.open('" + url + @"','','height=" + heigth + ",width=" + width + ",top=" + top + ",left=" + left + ",location=no,menubar=no,resizable=yes,scrollbars=yes,status=yes,titlebar=no,toolbar=no,directories=no');</Script>"; HttpContext.Current.Response.Write(js); }
willhuo 2015-01-10
  • 打赏
  • 举报
回复
你这是在用webbrowser控件?

110,537

社区成员

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

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

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