Refresh frame from another one

J

Just D.

All,

Who knows how can we refresh a secondary frame automatically if we do a
postback on the primary frame clicking some button control? Do we have any
meta tags to do that automatically or any other trick?

I saw that one guy was placing a hidden link button and used some trick with
__postback to simulate this button click from his code. It's not very
flexible way, but actually do we have anything else?

The reason is simple. I need that to refresh the datagrid on the second
frame when I did some changes to the data on the primary frame and I need
the secondary frame to be refreshed automatically. There is a very bad way
to add an auto refresh tag because it will require a lot of trips to the
server and back, that's originally a bad idea. From the other side using
this way the data will not be refreshed automatically at the same time as
the changes are made.

Dmitri.
 
V

Verde

RegisterStartupScript() is your friend here... use something like the
following code during your postback on the primary frame:

string scriptString = "<script
language=JavaScript>parent.OtherFrameName.location.reload(true)</script>";
if(!this.IsClientScriptBlockRegistered("clientScript")){
this.RegisterStartupScript("clientScript", scriptString);
}


-HTH
 

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

Members online

Forum statistics

Threads
473,996
Messages
2,570,238
Members
46,826
Latest member
robinsontor

Latest Threads

Top