如何在同一窗口中打开一个窗口 [英] how to open a window in same window
问题描述
你好,早上好,
我正在使用Java脚本在asp x页面中创建一个弹出窗口,在弹出窗口中,我使用了两个按钮取消"和确定"按钮,当我单击确定"按钮时,它应该重定向到登录页面,而当我单击它时,它在同一页面中重定向但是,当我单击确定按钮将其重定向到另一个页面却在另一个窗口中打开但我想在同一窗口中重定向时会发生问题.和即时通讯在aspx页面中使用它.
所以,请帮助我
我想用Java脚本编写代码
感谢您的帮助
Hello Good morning,
I am creating a popup window in my asp x page by using java script and in popup window i use two buttons cancel and OK buttons, when i click the OK button it should redirect to login page and when i click it redirect in the same page but the problem occurring when im clicking OK button it redirecting to another page but it opening in the another window but i want to redirect in the same window. and im using this in aspx page.
so,please help me
i want to write the code in java script
thank you for help
推荐答案
使用此
Use this
window.location = 'http://www.yourdomain.com'
试试这个...
将其添加到弹出页面..
Hi,
Try this...
Add it in the popup page..
<input type="button" id="btn_re" value="click me" onclick="redirect();" />
function redirect()
{
window.top.location="WebForm1.aspx";
}
谢谢.
Thanks..
使用Window.Open()
方法在同一窗口中打开.您需要将参数传递给它.
To open in same window withWindow.Open()
method. you need to pass parameter to it.
function openME()
{
window.open("test.aspx","_parent");
}
_parent 将帮助您在同一窗口中打开页面
_blank 将在新窗口中打开页面
默认情况下,此参数为 _blank
_parent will help you to open page in same window
_blank will open page in new window
bydefault this parameter is _blank
这篇关于如何在同一窗口中打开一个窗口的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!