Child window and repost problem.

  • Thread starter Fernando Chilvarguer
  • Start date
F

Fernando Chilvarguer

Hi,
I've been trying to figure this one out for a while and I'm stalled.

Here's my scenario:

- a Parent window with a datagrid on it. The datagrid has pagination enabled
and has an "Edit" link for each record.

- Once someone clicks on the "Edit" link, a child window pops-up. The user
edits the data and submits the form. All the server code is executed and
then I need to refresh the contents of the parent window and close the child
window. The following 2 lines of code do that:

Response.Write("<script>opener.document.location.reload();</script>");

Response.Write("<script>window.close();</script>");

BUT by using this method, IE 6.0 pops-up a warning message saying "the page
cannot be refreshed unless data is submited to the server, click RETRY to
continue". Basically warning you that information is going to be posted to
the server.

Is there any way to get the Client Window to refresh the Parent Window
WITHOUT this warning message popping-up?

(The reason for the "post" being triggered is due to the pagination being
enabled on the data grid, requesting the next page posts the data back to
the server).

THANKS!

Fernando

PS: Same thing happens on Firefox.
 
F

Fernando Chilvarguer

Is there a way of doing that in .NET?
I thought everything was based on POSTBACKS.
 
B

Brock Allen

Sure, you can do this, but you'll have to write code in Page_Load to check
for the QueryString parameters and then use them to sort/page your DataGrid.
Not too much different than doing it in the server event for DataGrid OnSort
or OnPageIndexChanged.

-Brock
DevelopMentor
http://staff.develop.com/ballen
 
F

Fernando Chilvarguer

OK,
I get that.
So there's no way to "convert" the datagrid control to use GET instead of
POST?

I ask because my datagrid has pagination and sorting enabled and it would a
lot easier the control would use GET every time a sort order or page index
changed.
(instead of having to implement it all manually)

Just want to make sure before I start coding away.
 

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

Top