473,385 Members | 2,269 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.

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 5959
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...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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.