I can not figure out how to get a WARP in the owner window of a pop-up window to do an async refresh when a button in the pop-up window is clicked. The function ig_getWebControlById returns null because it is looking for the WARP's id in the current pop-up window. I can get the owner window to do a full page refresh, but that is all. Anyone know how to do this? Please help!
How can you execute javascript inside a WARP I have tried this:
string js = "alert(1);"; LiteralControl child = new LiteralControl(js); this.Controls.Add(child); //or //this.WARP1.Controls.Add(child);
I have a web project doing things like your case.
In my case, i have a iframe in default.aspx. Inside the iframe is some other aspx file such as test.aspx.
What i'm doing is call a linkbutton click event with js inside default.aspx from another js inside test.aspx.
So i do some job below:
1.add a WebAsyncRefreshPanel in default.aspx and a linkbutton with id "lbRefreshInfos" inside the warp panel. Then set RefreshTargetIDs of warp to the controls that you want change.
2 write serverside code for linkbutton click event to apply the changes.
3 wrote a js called refreshActions(); in default.aspx . code blow:
function refreshActions(){__doPostBack('lbRefreshInfos','');
4 at the place of test.aspx where i want the default.aspx refresh it's info, I wrote the code below to let test.aspx call the js refreshActions of default.aspx.
Controls.Add(new LiteralControl("<script language='javascript'>parent.refreshActions();</script>"));
"Controls" is Controls property of warp or some panel inside warp
then it works in most case.
Some time there will have exceptions. Set EnableEventValidation="false" will help to hide the exception but I guess there are better way to handle it.
hope helpful for you.
EnableEventValidation="false"
I am using NetAdvantage for .NET 2007 Volume 1 CLR 2.0
Yeah, that is exactly what I am doing. But, the problem that I ran into is with the Infragistics JavaScript function ig_getWebControlById(). It must be called to get the WARP control object before you call .refresh() on it. But after debugging inside the function ig_getWebControlById() I found that it was looping through an array of objects "ig_all", but those were the Infragistics objects from the pop-up window. I guess this is because the pop-up window was the one that caused the event. Anyone know if there is a way to tell Infragistics to look in the "window.opener.document"? Or is there another way to do this?
Maybe you can try to write a js function 'A' in ' owner window ' to handle the async refresh .
and then write a js 'B' within pop-up window to call the js 'A'.
Give an id to ' owner window ' can help js 'B' find the window and call js 'A'.
it's just a little try. i'm not so sure about it.