Updating Parent Page
am 28.01.2008 20:24:15 von Wannabe
I have the following line of code in a couple pages:
ClientScript.RegisterStartupScript(typeof(Page), "ReloadParent",
"window.opener.location.href = 'summary.aspx?projectID=" +
Request.QueryString.Get("projectID") + "';", true);
On one page, this works just like I want it to. It updates the parent page
each time a value on it is changed. This exact same line does not work on a
different page. The only difference I can see is that the page where it does
not work has all controls in an update panel. Can that be the problem? If
that is the problem, is there anyway to get the page with the updatepanel to
update the parent page like the page that does it, and does not have an
update panel?
Re: Updating Parent Page
am 28.01.2008 22:19:39 von DFS
on an async postback (update panel), the panels html is passed back and
the panel div's innerHTML is set to the html. inline javascript is not
processed with this method. you need to the
ScripManager.RegisterStartupScript, which will pass the script back to
the client as a seperate parameter.
-- bruce (sqlwork.com)
Wannabe wrote:
> I have the following line of code in a couple pages:
>
> ClientScript.RegisterStartupScript(typeof(Page), "ReloadParent",
> "window.opener.location.href = 'summary.aspx?projectID=" +
> Request.QueryString.Get("projectID") + "';", true);
>
> On one page, this works just like I want it to. It updates the parent page
> each time a value on it is changed. This exact same line does not work on a
> different page. The only difference I can see is that the page where it does
> not work has all controls in an update panel. Can that be the problem? If
> that is the problem, is there anyway to get the page with the updatepanel to
> update the parent page like the page that does it, and does not have an
> update panel?
>
Re: Updating Parent Page
am 28.01.2008 22:40:02 von Wannabe
Works great...thank you.
"bruce barker" wrote:
> on an async postback (update panel), the panels html is passed back and
> the panel div's innerHTML is set to the html. inline javascript is not
> processed with this method. you need to the
> ScripManager.RegisterStartupScript, which will pass the script back to
> the client as a seperate parameter.
>
> -- bruce (sqlwork.com)
>
>
>
> Wannabe wrote:
> > I have the following line of code in a couple pages:
> >
> > ClientScript.RegisterStartupScript(typeof(Page), "ReloadParent",
> > "window.opener.location.href = 'summary.aspx?projectID=" +
> > Request.QueryString.Get("projectID") + "';", true);
> >
> > On one page, this works just like I want it to. It updates the parent page
> > each time a value on it is changed. This exact same line does not work on a
> > different page. The only difference I can see is that the page where it does
> > not work has all controls in an update panel. Can that be the problem? If
> > that is the problem, is there anyway to get the page with the updatepanel to
> > update the parent page like the page that does it, and does not have an
> > update panel?
> >
>