Re: cause webpage one to reload when webpage two is closed.
- From: Paul <Paul@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Wed, 18 Jun 2008 12:53:01 -0700
Hi Alexey,thanks for the additional information, that seemed to do the trick.
I probably should have mentioned I was closing form 2 programatically. Have
another minor issue, on webform one I am reading reading a session variable
which works now. The session variable is a generic list with a simple
structure as a datatype. The problem is on webform one when I try to display
it in a gridview control I get the error (datasource for gridview does not
have any properties or attributes from which to generate columns). For the
code I have
genericlist = (List<structRepo>)Session["genericlist"];
if (genericlist != null)
{
gridview.DataSource = genericlist;//
gvRepository.DataBind();
}
I also have the genericlist declared as public.
--
Paul G
Software engineer.
"Alexey Smirnov" wrote:
On Jun 18, 6:28 pm, Paul <P...@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote:.
Hi, thanks for the additional response. I tried the following but now it
appears that the first page is not reloading now but even when I close the
second page. To close the second page I am using an input button with the
following
<input id="btn_close" type="button" value="Close" onclick ="window.close()"
style="width: 100px" class="Button_sm" />.
Here is the code I added as specified, in the master page I added between
the head tags.
<script type="text/javascript">
function doUnload()
{
if (window.event.clientX < 0 && window.event.clientY < 0)
{
opener.location.href=opener.location.href;
}}
</script>
In the code behind on the second webform (the one that when closed should
cause the first page to refresh)
HtmlGenericControl body =
(HtmlGenericControl)Master.FindControl("MasterPageBodyTag");
body.Attributes.Add("onunload", "doUnload();");
thanks.
--
Paul G
Software engineer.
Paul, if you programmatically close the page by onclick
="window.close()" then it would be much easier to add the refresh call
directly to the onclick call. Try it
onclick="javascript:opener.location.href=opener.location.href;window.close();"
- Follow-Ups:
- Re: cause webpage one to reload when webpage two is closed.
- From: Alexey Smirnov
- Re: cause webpage one to reload when webpage two is closed.
- References:
- Re: cause webpage one to reload when webpage two is closed.
- From: Alexey Smirnov
- Re: cause webpage one to reload when webpage two is closed.
- From: Paul
- Re: cause webpage one to reload when webpage two is closed.
- From: Alexey Smirnov
- Re: cause webpage one to reload when webpage two is closed.
- From: Paul
- Re: cause webpage one to reload when webpage two is closed.
- From: Alexey Smirnov
- Re: cause webpage one to reload when webpage two is closed.
- From: Paul
- Re: cause webpage one to reload when webpage two is closed.
- From: Alexey Smirnov
- Re: cause webpage one to reload when webpage two is closed.
- From: Paul
- Re: cause webpage one to reload when webpage two is closed.
- From: Alexey Smirnov
- Re: cause webpage one to reload when webpage two is closed.
- Prev by Date: Server.Transfer
- Next by Date: Re: NodeStyle
- Previous by thread: Re: cause webpage one to reload when webpage two is closed.
- Next by thread: Re: cause webpage one to reload when webpage two is closed.
- Index(es):