473,385 Members | 1,888 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

PostBack


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
3 2880

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
> 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

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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Matthew Louden | last post by:
I created simple ASP.NET web application to test how AutoPostBack property in a web control works. I set AutoPostBack property to be true of a web control. When I run the application, here's the...
2
by: RAJ | last post by:
In our multi-tier application, we have several ASP.NET user controls which will update the same data source provided by middle tier logic. In this particular scenario we have one user control...
8
by: walesboy | last post by:
greetings - I have a btnSubmit button with a Handles btnSubmit.click which works great if all the user does is click that button. But, if the user ALSO changes a text box on the page (which...
4
by: Jim Hammond | last post by:
It would be udeful to be able to get the current on-screen values from a FormView that is databound to an ObjectDataSource by using a callback instead of a postback. For example: public void...
1
by: Timbo | last post by:
Hi all, This is my first message here so i'll try and include all the information that will help you help me out, if possible. Basically I am using C# in ASP.NET 2.0 and have a Repeater...
2
by: Wizzard | last post by:
I have a repeater with and imagebutton on a page useing VS2005 ASP.Net 2.0 <asp:Repeater ID="Repeater1" runat="server" > <ItemTemplate> <div> <asp:ImageButton ImageUrl="button.gif"...
11
by: antonyliu2002 | last post by:
I know that this has been asked and answered thousands of times. As a matter of fact, I know that I need to say If Not Page.IsPostBack Then 'Do something End If for things that needs to be...
2
by: Nathan Sokalski | last post by:
I have a DataList in which the ItemTemplate contains two Button controls that use EventBubbling. When I click either of them I receive the following error: Server Error in '/' Application....
7
by: Tony Girgenti | last post by:
Hello. I'm trying to undetrstand ASP.NET 2.0 and javascript. When i have a button and i click on it and i see the web broswer progress bar at the bottom do something, does that mean that there...
2
by: John Kotuby | last post by:
Hi guys, I am converting a rather complicated database driven Web application from classic ASP to ASP.NET 2.0 using VB 2005 as the programming language. The original ASP application works quite...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.