473,698 Members | 2,179 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Parent-Child window communication

SJ
Here's the scenario

Website has a button that pops up a confirmation window
when clicked.
When the user clicks the "confirm" button in this popup
window, I want all the following to happen :
a) Form data on the Parent (opener) page to be submitted.
b) Some (asp.net) code behind executed for the Parent
page.
c) Pop-Up window to close.

What would be the best approach to do this?

-SJ
Nov 19 '05 #1
9 2339
SJ <my******@sbcgl obal.net> wrote in news:eD5Xe.2776 $3V6.454
@newssvr11.news .prodigy.com:
Website has a button that pops up a confirmation window
when clicked.
When the user clicks the "confirm" button in this popup
window, I want all the following to happen :


Use javascript to submit the parent page.

--
Lucas Tam (RE********@rog ers.com)
Please delete "REMOVE" from the e-mail address when replying.

Newmarket Volvo Sucks! http://newmarketvolvo.tripod.com
Nov 19 '05 #2
SJ,

I have a javascript in my Javascript componet which you can download for
free from my website, www.aboutfortunate.com, that contains code for
attaching a javascript confirmation window to asp.net Buttons. The code on
my site is all free and you can download the entire projects for any of the
components on the site (plus a help file). The javascript component contains
a lot of useful functions, but even if you don't find the whole component
useful you could always look at the source code and pull out just the pieces
you need.

--
Sincerely,

S. Justin Gengo, MCP
Web Developer / Programmer

www.aboutfortunate.com

"Out of chaos comes order."
Nietzsche
"SJ" <my******@sbcgl obal.net> wrote in message
news:eD******** ********@newssv r11.news.prodig y.com...
Here's the scenario

Website has a button that pops up a confirmation window
when clicked.
When the user clicks the "confirm" button in this popup
window, I want all the following to happen :
a) Form data on the Parent (opener) page to be submitted.
b) Some (asp.net) code behind executed for the Parent
page.
c) Pop-Up window to close.

What would be the best approach to do this?

-SJ

Nov 19 '05 #3
a) window.opener.d ocument.forms[0].submit();
b) Submitting page would execute the code behind method in Page_Load
c) window.close();

Nov 19 '05 #4
SJ
sr**********@gm ail.com wrote:
a) window.opener.d ocument.forms[0].submit();
b) Submitting page would execute the code behind method in Page_Load
c) window.close();


Just out of curiosity, What if I want to pop-up a window with
some form data that needs to be submitted? Would it be wise
to have a pop-up like that or just change my design to incorporate
this form data into my main-page?
The reason I ask this is because don't browsers like firefox do a
real good job of preventing pop-up windows? Is it possible to fool
the browser and open a window anyway? If so, how.

-SJ
Nov 19 '05 #5
> if I want to pop-up a window with
some form data that needs to be submitted? Would it be wise
to have a pop-up like that
Not aware of any disadvatages in doing this. One advatage in
submitting popup form to itself is that you could reuse same popup page
from multiple parent pages if needed. But if you plan to use modal
window(ShowModa lDialog) , submitting to itself will popup another
window. To submit modal winows to itself you will be able to load the
page with form in an Iframe.
The reason I ask this is because don't browsers like firefox do a
real good job of preventing pop-up windows? Is it possible to fool
the browser and open a window anyway? If so, how.


not very sure on this. Do they block the modal windows too ? is there a
modal winow in firefox ?

Nov 19 '05 #6
SJ

<sr**********@g mail.com> wrote in message
news:11******** **************@ o13g2000cwo.goo glegroups.com.. .
if I want to pop-up a window with
some form data that needs to be submitted? Would it be wise
to have a pop-up like that


Not aware of any disadvatages in doing this. One advatage in
submitting popup form to itself is that you could reuse same popup page
from multiple parent pages if needed. But if you plan to use modal
window(ShowModa lDialog) , submitting to itself will popup another
window. To submit modal winows to itself you will be able to load the
page with form in an Iframe.
The reason I ask this is because don't browsers like firefox do a
real good job of preventing pop-up windows? Is it possible to fool
the browser and open a window anyway? If so, how.


not very sure on this. Do they block the modal windows too ? is there a
modal winow in firefox ?


Well, I dont think that is going to work for me either.
Basically, what I'm trying to do is something like this

website.aspx:
<form id="form1" runat="server">
<asp:TextBox id="Mytext" runat="server" />
<asp:imageButto n id="ResetButton " imageURL="blah. gif" runat="server" />
</form>

website.aspx.cs :
private void ResetButton_Cli ck(object sender,
System.Web.UI.I mageClickEventA rgs e)
{
// Code that will pop-up a window

// "form1" Processing
}

As you can see above, I need 2 things to happen when the "ResetButto n" is
clicked.
a) form submission and processing in the _Click event handler
b) Popup a window

Now, if I use regular HTML buttons, I can use an
"onClick=someJa vascriptFunctio n()" event in the website.aspx to pop-up a
window, but that prevents me from submitting/processing the form data using
the ResetButton_Cli ck event handler in the website.aspx.cs file.
I know that I could do form submission from the someJavascriptF unction() ,
but I dont want to do that.

I need the code-behind to open this pop-up window. If thats even possible.

I hope that makes sense?

Thanks.
Nov 19 '05 #7
look at the www.metabuilders.com. He has a Dialog Page framework that
works very well. You can use popup Form Pages, Confirmation Messages,
etc.

Nov 19 '05 #8
No need of 'form submission from the someJavascriptF unction() '
From Code behind (ResetButton_Cl ick event) you could use

Page.RegisterSt artupScript("<s cript>someJavas criptFunction() ;</script>");

Only way to open a pop-up window is writing/generating client side
script.

Nov 19 '05 #9
Replace "// Code that will pop-up a window" in "private void
ResetButton_Cli ck"
with below line of code

Page.RegisterSt artupScript("so mename","<scrip t>someJavascrip tFunction();</script>");

Nov 19 '05 #10

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

Similar topics

1
2585
by: Paul Gobée | last post by:
What is the parent element of a button (IE6 on Win, transitional mode)? Is it the BODY, the browser default stylesheet, or something else? Contra "body is parent-element": - Buttons with no style specified have a different font-size than the body's font-size. - If I change the body's font-size, a button with no style specified remains at the same font-size
5
3649
by: Suzanne Vogel | last post by:
Hi, Given: I have a class with protected or private data members, some of them without accessor methods. It's someone else's class, so I can't change it. (eg, I can't add accessor methods to the parent class, and I can't make some "helper" class a friend of the parent class to help in accessing the data.) Problem: I want to derive a class that has a copy constructor that properly copies those data members.
9
2075
by: jon wayne | last post by:
OK! I had this nagging doubt Consider (without worrying abt access specifiers) class Kid : public Parent{...}; Parent::someFunc() { Kid k; }
5
2381
by: Zürcher See | last post by:
The Control class has the Parent property that is readonly. When the control is added to a controls collection of another control the Parent property refers to that control. "Who" set the Parent property? How to implement this "mechanism"? public abstract class MyControl { private MyControl parent; public MyControl Parent{get{return this.parent;}}
2
2190
by: Roy | last post by:
Ok, this is incredibly annoying. Below I have an ImageButton and it's ImageButton_Click sub. See the 6 response.writes? The output for them is displayed below in asterisks. Question: What part of the TemplateColumn below does sender.parent.parent.Cells(9) reference??? IOW, what tag does it reference? The templatecolumn is the 9th field in the datagrid yet no matter what I do, whatever "sender.parent.parent.Cells(9)" is referencing, I do...
5
7662
by: Steve Richter | last post by:
In my user control I want to read the ViewState dictionary of the Parent control. But this sensible idea is not permitted by the compiler: Compiler Error Message: CS1540: Cannot access protected member 'System.Web.UI.Control.ViewState' via a qualifier of type 'System.Web.UI.Control'; the qualifier must be of type 'ASP.ItemOrderGrid' (or derived from it) Source Error:
1
4653
by: John A Grandy | last post by:
Let's say I have an .aspx Page instance derived from class "MyPage" (which of course inherits from System.Web.UI.Page). On the .aspx Page , I have "uc1", an instance of a UserControl dervived from "MyUserControl". uc1 is contained in a <td> in a <tr> in a <table> in a <td> in a <tr> of another <table> ... or some other form of deep nesting. In uc1 's code-behind I'd like to reference some properties of the parent
6
2545
by: Ray Schumacher | last post by:
What is the feeling on using "parent" in a class definition that class methods can refer to, vs. some other organization ? Should all relevant objects/vars just be passed into the method as needed? It seems like including "parent" in the class def is just like a class variable, which most do not recommend. An example: class LXSerial: def __init__(self, parent, debug=False): ...
5
2179
by: gnewsgroup | last post by:
In my user control, I would like to find a Label control in the parent page (the page that uses my user control). I need to update that Label.Text when something happens in the user control. I don't want to go through the hassle of creating events in the user control, and then let the parent handle the event. What is the easiest way to find a control in the parent page? Right now, I am simply manually traversing it from the user...
1
3793
by: bnchs | last post by:
This is C code. I am trying to fill each node's Parent field with its parent because I am drawing nodes to the screen. However, I have not been able to get this working. Reading the output from the code and tracing it, it seems that the code does not continue recursing down into the tree to insert. Can someone please point me to what is wrong and help me understand why it is wrong? Thank you. struct AvlNode* Insert( gint X, struct AvlNode*...
0
8674
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8604
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9157
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9028
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8895
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
6518
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
1
3046
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2330
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2001
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.