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

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.
 
M

Munsifali Rashid

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
 
S

Sedat Eyuboglu

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Staff online

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,012
Latest member
RoxanneDzm

Latest Threads

Top