Javascript popup questions...

  • Thread starter Thread starter Nicholas Then
  • Start date Start date
N

Nicholas Then

I have a usercontrol that contains a datagrid. This grid
lists information from my database. No big deal...this
works fine, and when the user selects an item I have a
popup window appear with the data that the user can
edit. Now when they click submit on the popup window to
save their changes, can I get the datagrid in the
usercontrol on the parent page to reload. I have been
trying to do this for about a year not and I have never
had any luck. If anyone could help me do this I would
greatly appreciate it.
 
Use window.opener on the popup window to access the parent
window. So call window.opener.MyFunction() to call a
javascript function in the parent.

In the function, you can cause a refresh in many ways,
from:
1) using javascript to redirect back to the page again,
but this will not preserve viewstate, right?
2) so you can also accomplish the same thing by calling a
postback:
http://msdn.microsoft.com/library/default.asp?
url=/library/en-us/cpguide/html/cpcongeneratingclient-
sidejavascriptforpostback.asp

Also take a look at this. Basically a tutorial for what
you are trying to do:
http://www.dotnetjunkies.com/Tutorial/F1DD7C01-4E9C-48E3-
B88C-F6D223A8EB9E.dcik

Jon Paugh
 
PS: What would really be cool is if something would create
a custom control to do all this stuff...
 
In the old world you can send stuff to and from a window. Something like
closewithreturn, check that on the parent and refresh. Now in .net I thought
all that javascript stuff was supposed to be taboo!
 
Back
Top