In article <hq************@no-mx.msusenet.com>, hqdtech.1nvg5z@no-
mx.msusenet.com says...
how to refresh webform from other webform
I have 2 webform, i want if webform A was close then webform B will
refresh.
And the problem second:
how to catch packet on the network in C#.
thanks.
--
hqdtech
------------------------------------------------------------------------
hqdtech's Profile: http://www.msusenet.com/member.php?userid=633
View this thread: http://www.msusenet.com/t-1869579909
Assuming you are trying to mimic the behavior of a windows forms
subform/popup/modal dialog, there are several ways to do this.
-- Disclaimer -- I'm doing this from my head so don't expect a cut and
paste to work without some debugging.
1.)Put a javascript function on your subform something like this:
function refreshopener()
{
if refresh==true
{
window.opener.location.reload();
window.close()
}
}
this, of course relies on a page-level variable called "refresh" so
you'll have to add that earlier:
var refresh=false;
Ok, now on the body declaration of your page add "OnLoad=refreshopener
()" which means that this function will fire everytime the page is
loaded (including postbacks ;))
Now, on your subform, I'm assuming there's some server-side event that
is fired that causes your page to refresh. After you've done all you
server-side processing, set the variable refresh to "true".
i.e. - Page.RegisterClientScriptBlock("refresher","<scrip t language-
javascript>refresh=true;</script>");
(You'll need to make sure that this script fires AFTER the variable
declaration above or this won't work).
As usual, you may find a simpler way, however this also allows me to do
other cleanup work within the refreshopener() function. I'll warn you
that I do tend to over complicate things ;)
SRC