473,287 Members | 1,555 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,287 software developers and data experts.

Pass events or data to IFRAME

I have a webform on this form is a User Control and another webform in
IFRAME
On the User Control there is a save button.

I want to click this button and somehow tell the webpage in IFRAME that the
button was clicked, how would I do that?
(in other words I want to save the webform data in IFRAME when the save
button is clicked)

Peter
--
Thanks
-------------------
cz****@wsinc.com
Nov 18 '05 #1
3 5949
If you want to "talk" to an iframe using client side script, you just need
to use something like this:

document.frames("frameName").document.forms("formN ame").submit().

--
Chris Jackson
Software Engineer
Microsoft MVP - Windows Client
Windows XP Associate Expert
--
More people read the newsgroups than read my email.
Reply to the newsgroup for a faster response.
(Control-G using Outlook Express)
--

"Peter" <cz****@wsinc.com> wrote in message
news:%2******************@TK2MSFTNGP11.phx.gbl...
I have a webform on this form is a User Control and another webform in
IFRAME
On the User Control there is a save button.

I want to click this button and somehow tell the webpage in IFRAME that
the
button was clicked, how would I do that?
(in other words I want to save the webform data in IFRAME when the save
button is clicked)

Peter
--
Thanks
-------------------
cz****@wsinc.com

Nov 18 '05 #2
Thanks for your help!

What about if there are more than one button, say 'Save' and 'Delete'
buttons how do I know which one was clicked?

"Chris Jackson" <chrisjATmvpsDOTorgNOSPAM> wrote in message
news:uB**************@TK2MSFTNGP09.phx.gbl...
If you want to "talk" to an iframe using client side script, you just need
to use something like this:

document.frames("frameName").document.forms("formN ame").submit().

--
Chris Jackson
Software Engineer
Microsoft MVP - Windows Client
Windows XP Associate Expert
--
More people read the newsgroups than read my email.
Reply to the newsgroup for a faster response.
(Control-G using Outlook Express)
--

"Peter" <cz****@wsinc.com> wrote in message
news:%2******************@TK2MSFTNGP11.phx.gbl...
I have a webform on this form is a User Control and another webform in
IFRAME
On the User Control there is a save button.

I want to click this button and somehow tell the webpage in IFRAME that
the
button was clicked, how would I do that?
(in other words I want to save the webform data in IFRAME when the save
button is clicked)

Peter
--
Thanks
-------------------
cz****@wsinc.com


Nov 18 '05 #3
Thank you so much, this is just want I needed, I appreciate all of your
help!!!
"Steven Cheng[MSFT]" <v-******@online.microsoft.com> wrote in message
news:Bp**************@cpmsftngxa07.phx.gbl...
Hi Peter,
Thanks for posting in the community!
From your description, you'd like to post back a sub page in a iframe when
a certain button on its parent(container page) is clicked. Also, you'd like to pass the certain button's id to the sub page so that in the sub page's
postback process ,you can got the info on which button in container page is clicked, yes?
If there is anything I misunderstood, please feel free to let me know.

As for this problem, Chris has supply the correct direction that use the
javascript to submit the page in the iframe. And as to how to pass the
button's id info, my suggestion is putting a hidden field(<input
type=hidden value=" .." ... > to store the info, and when a certain
button in container page is clicked, first set the hidden field in subpage
and then submit it. For detailed illustration, I've attached a couple of
sample pages using this means.

In addition, I've some further suggestions on this issue:
1. When you used <Iframe> to contain a certain page, then if the container
page is posted back, it'll refresh the sub page also. So as for your
situation, if you want to notify the sub page for the parent page's event
and then do some operations, you need to use different means according to
the button's event type(server button event or client event)
(1): If is the server button event, you'd like to notify the sub page after the sub page is posted back , thus, the sub page can do the certain
operations after it is refreshed caused by its parent page's postback.

(2): If you notify the sub page at the buttons' client click event, since
the parent page isn't posted back, you needn't to code as (1), just call
javascript to posted back the sub page.

I've including the both situations in my sample page, you may refer to it
if you feel anything unclear.

2. I've noticed that you used UserControl to contain some certain buttons
and which will need to control some other element ourside it(in its
container page). I think sometimes, it's better to avoid using UserControl
since UserControl will make its controls's clientID changed( not the same
as those which are directly put onto a page), that'll cause some problems
or difficulties when we implement javascript code on them to associate with some other pages or elements.
Do you think so?

Please check out the preceding suggestions and my sample pages. If you have anything unclear, please feel free to post here.

Regards,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Get Preview at ASP.NET whidbey
http://msdn.microsoft.com/asp.net/whidbey/default.aspx

Nov 18 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

24
by: ej1002 | last post by:
Hi I have developed a Windows Application(C# Windows Form) which will get the IFrame Source of the page it is navigating using Webbrowser Control. Now I want do this in ASP.Net web application(C#...
2
by: Hadar | last post by:
Hi, I ran into a closed thread with the title "Want to be able to pass parameters to an IFRAME" The need to pass I tried to implement what they suggested but i got an error: "The Controls...
8
by: darrel | last post by:
I'm still trying to fully understand how best to pass variables between pages/usercontrols/each other. On a current site I've done, I've had one userControl do the logic and set the variable,...
12
by: scsharma | last post by:
Hi, I am working on creating a webapplication and my design calls for creating main webform which will have menu bar on left hand side and a IFrame which will contain all the forms that are shown...
2
by: jceddy | last post by:
Well, there is something here I'm working on, and I have a problem that has several possible solutions...none of which I can figure out how to implement. Basically, I am creating a rich text...
4
by: Venkatesh | last post by:
Hello All, I have an iframe in my main html and within iframe, I'm loading another HTML webpage. In my main html page, I've captured the mouse click event, by setting the "onclick" for <bodyof...
2
by: bbsbob | last post by:
Hello, I'm still using the Framework v1.1. Forgive me, I'm working on a legacy application. I'm using 2 iFrame sections with 2 aspx pages, i.e. 1.aspx (left) and 2.aspx (right) In 1.appx page,...
4
by: ismailc | last post by:
Hi, I need help please. I need to create a textbox with a report url in an iframe below. Onclick of button create IFrame and pass textbox value into parameter of iframe src. I'm not to sure...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: Aftab Ahmad | last post by:
Hello Experts! I have written a code in MS Access for a cmd called "WhatsApp Message" to open WhatsApp using that very code but the problem is that it gives a popup message everytime I clicked on...
0
by: Aftab Ahmad | last post by:
So, I have written a code for a cmd called "Send WhatsApp Message" to open and send WhatsApp messaage. The code is given below. Dim IE As Object Set IE =...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...

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.