当网页2关闭时,导致网页重新加载。 [英] cause webpage one to reload when webpage two is closed.

查看:89
本文介绍了当网页2关闭时,导致网页重新加载。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好我试过谷歌搜索但找不到任何东西。我试图在第二个网页关闭时重新加载一个网页

。第二个网页

将数据加载到会话变量中,当关闭时,我需要从会话变量重新加载第一个

页面加载数据。因为我需要关闭

这个sescond表单只是将帖子后面的url设置为第二页上

关闭按钮的第一页,这不是我想要的。

-

Paul G

软件工程师。

Hi I tried a google search but could not find anything. I am trying to cause
one webpage to reload when a second web page is closed. The second webpage
loads data into a session variable and when closed I need to reload the first
page loading in the data from the session variable. Since I need to close
the sescond form just setting the post back url to the first page on the
close button from the second page is not quite what I am looking for.
--
Paul G
Software engineer.

推荐答案

6月17日,9:19 * pm,Paul< P ... @ discussion.microsoft.comwrote:
On Jun 17, 9:19*pm, Paul <P...@discussions.microsoft.comwrote:

您好我试过谷歌搜索但是找不到任何东西。 *我试图在第二个网页关闭时重新加载一个网页

。 *第二个网页

将数据加载到会话变量中,当关闭时,我需要从会话变量重新加载第一个

页面加载数据。 *因为我需要关闭

这个sescond表单只是将帖子后面的url设置到第二页的

关闭按钮的第一页上并不是我想要的for。

-

Paul G

软件工程师。
Hi I tried a google search but could not find anything. *I am trying to cause
one webpage to reload when a second web page is closed. *The second webpage
loads data into a session variable and when closed I need to reload the first
page loading in the data from the session variable. *Since I need to close
the sescond form just setting the post back url to the first page on the
close button from the second page is not quite what I am looking for.
--
Paul G
Software engineer.



您好Paul,


尝试将以下代码添加到您的第二个网页


< body onunload =" opener.location.href = opener.location.hre f;">


您可能也有兴趣看到以下主题
http://forums.asp.net/t/988319。 aspx


希望这有帮助

Hi Paul,

Try to add the following code to your second web page

<body onunload="opener.location.href=opener.location.hre f;">

You might be also interested to see the following thread
http://forums.asp.net/t/988319.aspx

Hope this helps


您好,感谢您的回复。

我尝试将

< body onunload =" opener.location.href = opener.location.hre f;">< / body>

添加到第二页的源但是得到错误

元素体不能嵌套在元素td中。我把代码放在第二种形式的aspx文件中。


< asp:Content ID =" Content1" ContentPlaceHolderID =" ContentPlaceHolder1"

Runat =" Server">


< body onunload =" opener.location.href = opener.location .hre f;">< / body>

后跟几个html表格。

无论如何只是想知道在哪里放置正文标签?


另外用户从第一页进入第二页的方式只是一个

超链接。

谢谢。


-

Paul G

软件工程师。

" Alexey Smirnov"写道:
Hi, thanks for the response.
I tried adding
<body onunload="opener.location.href=opener.location.hre f;"></body>
to the source of the second page but get the error
element body can not be nested within element td. I placed the code as
follows in the second form aspx file.

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1"
Runat="Server">

<body onunload="opener.location.href=opener.location.hre f;"></body>
followed by several html tables.
Anyhow just wondering where to place the body tag?

Also the way the user gets to the second page from the first page is just a
hyperlink.
thanks.

--
Paul G
Software engineer.
"Alexey Smirnov" wrote:

6月17日,9:19 pm,Paul< P ... @ discussion.microsoft.comwrote:
On Jun 17, 9:19 pm, Paul <P...@discussions.microsoft.comwrote:

您好我试过谷歌搜索但找不到任何东西。我试图在第二个网页关闭时重新加载一个网页

。第二个网页

将数据加载到会话变量中,当关闭时,我需要从会话变量重新加载第一个

页面加载数据。因为我需要关闭

这个sescond表单只是将帖子后面的url设置为第二页上

关闭按钮的第一页,这不是我想要的。

-

Paul G

软件工程师。
Hi I tried a google search but could not find anything. I am trying to cause
one webpage to reload when a second web page is closed. The second webpage
loads data into a session variable and when closed I need to reload the first
page loading in the data from the session variable. Since I need to close
the sescond form just setting the post back url to the first page on the
close button from the second page is not quite what I am looking for.
--
Paul G
Software engineer.



您好Paul,


尝试将以下代码添加到您的第二个网页


< body onunload =" opener.location.href = opener.location.hre f;">


您可能也有兴趣看到以下主题
http://forums.asp.net/t/988319。 aspx


希望这有帮助


Hi Paul,

Try to add the following code to your second web page

<body onunload="opener.location.href=opener.location.hre f;">

You might be also interested to see the following thread
http://forums.asp.net/t/988319.aspx

Hope this helps


6月17日,10:28 * pm,Paul < P ... @ discussion.microsoft.comwrote:
On Jun 17, 10:28*pm, Paul <P...@discussions.microsoft.comwrote:

您好,感谢您的回复。

我尝试添加

< body onunload =" opener.location.href = opener.location.hre f;">< / body>

到第二页的来源但是得到错误

元素体不能嵌套在元素td中。 *我将代码放在第二种形式的aspx文件中。


< asp:Content ID =" Content1" ContentPlaceHolderID =" ContentPlaceHolder1"

Runat =" Server">


*< body onunload =" opener.location.href = opener。 location.hre f;">< / body>


后跟几个html表。

总之只是想知道在哪里放置body标签?


另外,用户从第一页进入第二页的方式只是一个

超链接。

谢谢。


-

Paul G

软件工程师。


" Alexey Smirnov" ;写道:
Hi, thanks for the response.
I tried adding
<body onunload="opener.location.href=opener.location.hre f;"></body>
to the source of the second page but get the error
element body can not be nested within element td. *I placed the code as
follows in the second form aspx file.

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1"
Runat="Server">

* <body onunload="opener.location.href=opener.location.hre f;"></body>

followed by several html tables.
Anyhow just wondering where to place the body tag?

Also the way the user gets to the second page from the first page is just a
hyperlink.
thanks.

--
Paul G
Software engineer.

"Alexey Smirnov" wrote:

6月17日晚上9:19,Paul< P ... @ discussion.microsoft.comwrote:
On Jun 17, 9:19 pm, Paul <P...@discussions.microsoft.comwrote:

您好我试过谷歌搜索但找不到任何东西。 *我试图在第二个网页关闭时重新加载一个网页

。 *第二个网页

将数据加载到会话变量中,当关闭时,我需要从会话变量重新加载第一个

页面加载数据。 *因为我需要toclose

sescond表单只是将帖子后面的url设置到第二页的

关闭按钮的第一页,这不是我想要的。

-

Paul G

软件工程师。
Hi I tried a google search but could not find anything. *I am tryingto cause
one webpage to reload when a second web page is closed. *The second webpage
loads data into a session variable and when closed I need to reload the first
page loading in the data from the session variable. *Since I need toclose
the sescond form just setting the post back url to the first page on the
close button from the second page is not quite what I am looking for.
--
Paul G
Software engineer.


嗨Paul,
Hi Paul,


尝试添加以下代码到您的第二个网页
Try to add the following code to your second web page


< body onunload =" opener.location.href = opener.location.hre f;" >
<body onunload="opener.location.href=opener.location.hre f;">


您可能也有兴趣看到以下主题
http://forums.asp.net/t/988319.aspx


希望这有帮助 - 隐藏引用的文字 -
Hope this helps- Hide quoted text -



- 显示引用的文字 -


- Show quoted text -



BODY元素包含文档的所有内容,包括TD

和TABLE。它只能嵌套在HTML元素中。看来

你正在使用Master页面,这意味着你应该更改Master页面的BODY

元素。如果Master页面用于许多内容

页面,那么您可以复制它(将更改应用于

BODY标记),或者您可以设置您的主页page body标签:


< body id =" mBody" runat =" server">


然后在必须关闭的页面上添加:

public void Page_Load(Object sender ,EventArgs e)

{

HtmlGenericControl body =

(HtmlGenericControl)Master.FindControl(" mBody");

body.Attributes.Add(" onunload",

" opener.location.href = opener.location.href;");

}


我没有测试它,但我认为它应该可行。

The BODY element contains all the content of a document, including TD
and TABLE. It can be nested within HTML element only. It seems that
you are using Master page and it means you should change a BODY
element of the Master page. If Master page is used for many Content
pages then you can either make a copy of it (to apply changes to the
BODY tag), or you can set your Master page body tag to:

<body id="mBody" runat="server">

Then add this on the page that has to be closed:

public void Page_Load(Object sender, EventArgs e)
{
HtmlGenericControl body =
(HtmlGenericControl)Master.FindControl("mBody");
body.Attributes.Add("onunload",
"opener.location.href=opener.location.href;");
}

I didn''t test it, but I think it should work.


这篇关于当网页2关闭时,导致网页重新加载。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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