Link to home
Start Free TrialLog in
Avatar of Tom Knowlton
Tom KnowltonFlag for United States of America

asked on

web form raise event that another webform consumes?

Is it possible to raise an event in one web form and have another web form consume it?
Avatar of Imran Javed Zia
Imran Javed Zia
Flag of Pakistan image

Hi,

In case of a popup, you can use javascript funtions to call and access child objects and vise versa.
In other case you can use PostbackUrl to transfer the control with some form data to be used.

in any other case please elaborate the details
Thanks
Avatar of Tom Knowlton

ASKER

FormOne.aspx raises event "A"

FormTwo.aps responds to event "A"
**FormTwo.aspx responds to event "A"
SOLUTION
Avatar of Chinmay Patel
Chinmay Patel
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Isn't it something that is happening in almost all web application - you click a Submit button
on one Web form it will call associated Action page, which would processs the input data and can
present a new form?

If you provide a description of the actual situation, in terms of specific
user needs, that you want to address, that may help to understand your point.
I am talking about two pages on the same domain.  One page is inside of an iframe.  The other page is the page that contains the iframe.

Page inside iframe raises an event.

Page containing that same iframe consumes the event.
So you want that when user say clicks a button inside iFrame, then something happens on the page
which contains this iFrame?

If this what is your wish, it looks like this discussioi (with solution at the bottom)
may help you
http://www.webdeveloper.com/forum/showthread.php?t=94925
That you can easily trigger by using JavaScript. Even if you want to consume code on server side, all you have to do is...  call click metohd on a button on the second page, you can keep that button hidden if you don't want to show your end user.

Yes, Javascript is the solutiojn, and the link I posted above talks about some details of JavaScript just in this case - how to refer to parent page from iFrame, etc.
Hmm.. I am busy shopping online.. forgot to press submit early :D
I tried looking at the link, but it did not make much sense to me.

Let's begin with the page in the iframe.  I want to raise an event when it is finished loading.

What would the JavaScript look like for this?
You can define onLoad() finction  inside that page
What this link is about is just how to refer to your mother page from the iFrame
So in that onLoad() function you'll probably need to do that - to refer to elements of "mother" frame
in your iFrame
This javascript onLoad() function....do I make it part of the page in the iframe....or does this code go in the parent page code?
Why would you want to do somethng immediately on load of the iFrame?
I rather assumed you would want to respond to soem user
event in the iFrame. What happens on load you know from the very beginning?
No if you want this depend on loading of the iFrame page, I'd think you need to put it into iFrame
page, but see my previous comment - difficult to undestand the situation when you would want it
The way the current page is working is that the parent page has an iframe.

I know that when the page inside the iframe finishes loading, I am then ready to redirect the parent page to another page.

But I don't want to redirect the parent page UNTIL the page inside the iframe is finished loading.
Well, I see, so you want to load parent page - kind of in the process it will load also iFrame, aand as sioon
as iFrame is loaded you want to keep this iFrame and replace the "mother" page - is this correct?
User generated image
Step 1:
User clicks on green button.  Page inside the iframe submits info to the third party web server that it belongs to.

Step 2:
The third party server redirects BACK to a page on the same domain as the parent page.  At this point, both the parent page and the page inside the iframe are pages that reside on the same server, same folder, same domain.

Step 3:
This represents the page inside the iframe in Step 2 has finished loading.  It is the fact that the page has finished loading event that I am interested in
knowing about

Step 4:
This is an entirely new page with no iframe.  The parent page in Step 3 redirected to the new page upon completion of the iframe in Step 3 finishing the loading process.



NOTE:  It is the same parent page (and iframe) in Steps 1 thru 3.

In Steps 2 and 3, the page inside the iframe comes from the same domain as the Parent page.
Yes, I see the issue.
So  you in no control of the code that is being sent to your iFrame after step 2?
But you can modify only the outer pages?
And you can't even change the code which is loaded into iFrame in the first moment either?
Anothher question - so you probably don't care that your user sees it in the sate 3.
As sson as you know that intercation with third party has run its course, you
want to replace the page not consulting with your user -correct?
I cannot change the code for the page inside the iframe in Step 1, that is true.

But I can modify the code for the page both inside the iframe as well as for the parent page for Steps 2 thru 4, since both pages are under my control and reside on the same server.

The problem is that the iframe is kind of like it's own browser.  The page inside the iframe has no knowledge of the parent and vice versa.  It is this condition I hope to circumvent.
As sson as you know that intercation with third party has run its course, you
want to replace the page not consulting with your user -correct?

==============

Correct.  The content of the page inside the iframe in Steps 2 and 3 is irrelevant, really.  Now, I should mention that when the iframe page in Step 3 has finsihed loading, the page it redirects to will depend upon the page the parent redirects to in Step 4.  But the biggest problem I face is how do I notify the parent page in Step 3 that the page inside the iframe has finished loading?
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
thx.

We eventually went in another direction not really relevant to this question and too involved to explain.

But I appreciate the time and the effort!!

Tom