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?
LVL 5
Tom KnowltonWeb developerAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Imran Javed ZiaConsultant Software Engineer - .NET ArchitectCommented:
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
0
Tom KnowltonWeb developerAuthor Commented:
FormOne.aspx raises event "A"

FormTwo.aps responds to event "A"
0
Tom KnowltonWeb developerAuthor Commented:
**FormTwo.aspx responds to event "A"
0
Determine the Perfect Price for Your IT Services

Do you wonder if your IT business is truly profitable or if you should raise your prices? Learn how to calculate your overhead burden with our free interactive tool and use it to determine the right price for your IT services. Download your free eBook now!

Chinmay PatelChief Technical NinjaCommented:
No. This seems like a bad design. If you can throw some more light on the issue at hand you might get a better solution.
You could init a second page and then explicitly call the event on the first Page itself but I won't recommend that.
0
for_yanCommented:
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.
0
Tom KnowltonWeb developerAuthor Commented:
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.
0
for_yanCommented:
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
0
Chinmay PatelChief Technical NinjaCommented:
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.

0
for_yanCommented:
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.
0
Chinmay PatelChief Technical NinjaCommented:
Hmm.. I am busy shopping online.. forgot to press submit early :D
0
Tom KnowltonWeb developerAuthor Commented:
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?
0
for_yanCommented:
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
0
Tom KnowltonWeb developerAuthor Commented:
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?
0
for_yanCommented:
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?
0
for_yanCommented:
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
0
Tom KnowltonWeb developerAuthor Commented:
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.
0
for_yanCommented:
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?
0
Tom KnowltonWeb developerAuthor Commented:
iframe steps
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.
0
for_yanCommented:
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?
0
for_yanCommented:
And you can't even change the code which is loaded into iFrame in the first moment either?
0
for_yanCommented:
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?
0
Tom KnowltonWeb developerAuthor Commented:
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.
0
Tom KnowltonWeb developerAuthor Commented:
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?
0
for_yanCommented:
I see, it is rather tough issue in my mind.
Perhaps you can make some javascript looping with some
wait in between and checking from time to time what url is loaded into iFrame
window?

Because you have no control on what is loaded into the iframe you can not put any
additional javascript there to do some change in your parent
so you'll probably have to do it vfrom the other side,
and I think javascript of the parent can keep track of the iFrame as the window and can report to you what URL
it is pointing to.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Tom KnowltonWeb developerAuthor Commented:
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
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Web Development

From novice to tech pro — start learning today.