How can i refresh a frame's source page from Page_Load func.

  • Thread starter Thread starter Sedat Eyuboglu
  • Start date Start date
S

Sedat Eyuboglu

i have a frame page and when the main frame's page loaded the header frame
must be refreshed.
i do this with the javascript and onLoad event of body tag. but i want to
do this from the Page_load event of the page class.
what is the methode for this.

the main problem i want to this with vb code from the page class. i don't
want to touch js or html any more:)) may be a little.
 
You can't do this from the page_load class using server-side code, as this
code runs on the server, and the frame can only be refreshed client-side.
What you could do as a workaround is register a client-side script in the
page_load event, which will update the top frame. Eg.

Page.RegisterStartupScript("reload", "<script
language='JavaScript'>parent.frames["top"].location.reload()</script>");

Regards,

Mun
 
i have thought that there must be a method creating client script. this is
it... thanx....

Munsifali Rashid said:
You can't do this from the page_load class using server-side code, as this
code runs on the server, and the frame can only be refreshed client-side.
What you could do as a workaround is register a client-side script in the
page_load event, which will update the top frame. Eg.

Page.RegisterStartupScript("reload", "<script
language='JavaScript'>parent.frames["top"].location.reload()</script>");

Regards,

Mun
 
Back
Top