By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
429,214 Members | 2,099 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 429,214 IT Pros & Developers. It's quick & easy.

PostBack

P: n/a

Dear All

I want to call dopostback of parent window from child window.

Scenerio
I am opening window from a page, and i have datatable in session which is
updating at parent window and at child window both.
when I close the child window and reloads the parent window from javascript
it lost all information because it walks into
"Not Ispostback" condition para.

How i can reload the parent page which did not walk into this condition
para.

Regards
Abid
Nov 18 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a

Normally, you would expect to do this with

window.opener.document.forms[0].submit();

but this would not work because the IE implementation of form.submit() is
different from the standard implementation.

Nevertheless, there's a clever way to simulate a postback on the parent
window in javascript.

Put an invisible button to the parent page. Something like below;

<input type="submit" name="fakeButton" style="DISPLAY: none" value="Submit">

Then from the child window, do the following;

window.opener.document.forms[0].fakeButton.click();

This will submit the form back to itself, hence you have a postback.

Hope this helps,

Ethem Azun
"Abid Ali" wrote:

Dear All

I want to call dopostback of parent window from child window.

Scenerio
I am opening window from a page, and i have datatable in session which is
updating at parent window and at child window both.
when I close the child window and reloads the parent window from javascript
it lost all information because it walks into
"Not Ispostback" condition para.

How i can reload the parent page which did not walk into this condition
para.

Regards
Abid

Nov 18 '05 #2

P: n/a
> window.opener.document.forms[0].submit();

but this would not work because the IE implementation of form.submit() is
different from the standard implementation.
This is news to me. Can you elaborate?

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
I get paid good money to
solve puzzles for a living

"Ethem Azun" <Et*******@discussions.microsoft.com> wrote in message
news:4C**********************************@microsof t.com...
Normally, you would expect to do this with

window.opener.document.forms[0].submit();

but this would not work because the IE implementation of form.submit() is
different from the standard implementation.

Nevertheless, there's a clever way to simulate a postback on the parent
window in javascript.

Put an invisible button to the parent page. Something like below;

<input type="submit" name="fakeButton" style="DISPLAY: none" value="Submit">
Then from the child window, do the following;

window.opener.document.forms[0].fakeButton.click();

This will submit the form back to itself, hence you have a postback.

Hope this helps,

Ethem Azun
"Abid Ali" wrote:

Dear All

I want to call dopostback of parent window from child window.

Scenerio
I am opening window from a page, and i have datatable in session which is updating at parent window and at child window both.
when I close the child window and reloads the parent window from javascript it lost all information because it walks into
"Not Ispostback" condition para.

How i can reload the parent page which did not walk into this condition
para.

Regards
Abid

Nov 18 '05 #3

P: n/a

Hi Kevin,

From below, you can see the The HTML DOM Level 2 standard. It says that
calling form.submit() should do the same as button.submit().

http://www.w3.org/TR/2003/REC-DOM-Le...ml#ID-76767676

This means, when you submit a form, the onsubmit event should normally fire.
But this does not happen if you use IE.

I use the workaround I specified before to get over this problem, simply
"clicking" on an invisible submit button on the form, from outside. You can
test this behavoir by creating two pages in which one pops the other up and
the popup tries to submit the opener form.

Ethem Azun

"Kevin Spencer" wrote:
window.opener.document.forms[0].submit();

but this would not work because the IE implementation of form.submit() is
different from the standard implementation.


This is news to me. Can you elaborate?

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
I get paid good money to
solve puzzles for a living

"Ethem Azun" <Et*******@discussions.microsoft.com> wrote in message
news:4C**********************************@microsof t.com...

Normally, you would expect to do this with

window.opener.document.forms[0].submit();

but this would not work because the IE implementation of form.submit() is
different from the standard implementation.

Nevertheless, there's a clever way to simulate a postback on the parent
window in javascript.

Put an invisible button to the parent page. Something like below;

<input type="submit" name="fakeButton" style="DISPLAY: none"

value="Submit">

Then from the child window, do the following;

window.opener.document.forms[0].fakeButton.click();

This will submit the form back to itself, hence you have a postback.

Hope this helps,

Ethem Azun
"Abid Ali" wrote:

Dear All

I want to call dopostback of parent window from child window.

Scenerio
I am opening window from a page, and i have datatable in session which is updating at parent window and at child window both.
when I close the child window and reloads the parent window from javascript it lost all information because it walks into
"Not Ispostback" condition para.

How i can reload the parent page which did not walk into this condition
para.

Regards
Abid


Nov 18 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.