showModalDialog中的按钮的OnClick,它将打开新窗口. [英] OnClick of button in showModalDialog, it opens new window..?

查看:113
本文介绍了showModalDialog中的按钮的OnClick,它将打开新窗口.的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好,

我有两个页面A.aspx和B.aspx页面
A.aspx通过javascript函数window.showModalDialog("B.aspx");将B.aspx作为模式弹出窗口打开.

B.aspx页有两个文本框(登录,密码),< asp:Button>服务器代码中的控件和按钮单击事件.

问题是,当我单击提交"按钮时,它会在新的第三个窗口中打开B.aspx页.如何在提交按钮上不打开新窗口.

请建议我.

Hello,

I have two pages A.aspx and B.aspx Page
A.aspx opens B.aspx as modal popup by javascript function window.showModalDialog("B.aspx");

Page B.aspx has two text boxes (Login, Password), <asp:Button> control and button click event in server code.

Problem is when I click on the submit button it opens me B.aspx page in new third window How is it possible to not open new window on submit button.

please suggest me.

推荐答案

这完全是错误的网站登录UI方法.我不确定造成问题的技术原因是什么(您可以在按钮处理程序中再次调用showModalDialog或createWindow,或者在链接或表单标签上设置的目标属性有误),但不应在网络上以这种方式使用Windows.

使用asp:LoginPanel并内联运行登录页面.如果您不希望在登录之前看到任何内容,请将重定向(Response.Redirect或将其他页面放在身份验证墙后面)重定向到登录页面.
This is completely the wrong way to do login UI for a website. I''m not sure what the technical reason for your problem is (either you call showModalDialog or createWindow again in the button handler, or you have a target attribute set wrong on a link or form tag), but you shouldn''t be using windows in this way on the web.

Use an asp:LoginPanel and run a login page inline. If you don''t want any content to be visible before logging in, redirect (Response.Redirect or put the other pages behind an authentication wall) to a login page.


这篇关于showModalDialog中的按钮的OnClick,它将打开新窗口.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆