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

Calling Child form Event from parent form?

daffurankan
hai,
could i call the child form events like (closing ,load, activate,closed) .
]from the parent mdi form.


Reply asap.
Waitng for reply ANKAN Rastogi
Oct 20 '09 #1
6 4891
Frinavale
9,735 Expert Mod 8TB
Um, this is not possible in ASP.NET
In ASP.NET there are no mdi forms.

ASP.NET is a web technology that lets you create dynamic HTML pages based on some server-side .NET code.

Server-side .NET code is executed which results in HTML that is sent to a web browser to be rendered and shown to the user. Once the HTML has been sent to the web browser the server-side code is finished executing (all objects etc used for this are destroyed).

In other words ASP.NET executes in a "stateless" environment. There is no connection to the server code...the HTML is sent to the browser and the server just waits until the user clicks a button/link/image/etc that makes a new request to the server to do some execution....then the server-side code does some execution and sends the HTML result back to the browser.

As you can see there are 2 basic components here: Server-Side and Client-Side.

Client-side is what happens in the web browser. If the user opens a new browser window, it's done client-side. If the user closes a child browser window, it's done client side. The server-side code is completely unaware of what happens client side. You need to control things client-side using a client-side language like JavaScript.

JavaScript can monitor child web-browsers and for the most part can tell when windows are being opened or closed or about to close....

I hope I've clarified the basics of ASP.NET for you,

-Frinny
Oct 20 '09 #2
thank'x a lot but it ha dhappen in vb.net windows applivation.
Nov 30 '09 #3
ThatThatGuy
449 Expert 256MB
@daffurankan
You can all of the events of form2 (child) in form1(parent)....
if any event is public....

But you should avoid doing this.... bcoz events should not be revealed...
instead call the specified event method by creating another method inside a child form and then call it from there....
Nov 30 '09 #4
Frinavale
9,735 Expert Mod 8TB
This question still doesn't make sense to me.
You cannot have a child form and a parent form in ASP.NET.

You can have 2 open browser windows...but this is different.
You can use the JavaScript window.opener to call a JavaScript function in the parent browser from a child browser. This JavaScript function could then do a postback to the server.

-Frinny
Nov 30 '09 #5
ThatThatGuy
449 Expert 256MB
But frinavale, Daffurankan has already mentioned it's a vb.net application...
in reply #3......

He has by mistake, posted this question in the wrong section
Dec 1 '09 #6
Frinavale
9,735 Expert Mod 8TB
And apparently they made a mistake in the Title of the thread too: "In ASP.NET calling child form event from parent form".

Well if this is a desktop application, it's in the wrong forum and the answer to the problem is completely different.

I've moved the question to the VB.NET forum and I have removed "In ASP.NET" from the title since this has nothing to do with ASP.NET.

I would not call a method that handles an event in one form from another form. I would raise a new event to inform the parent form instead.

-Frinny
Dec 1 '09 #7

Sign in to post your reply or Sign up for a free account.

Similar topics

13
by: Stuart McGraw | last post by:
I haven't been able to figure this out and would appreciate some help... I have two tables, both with autonumber primary keys, and linked in a conventional master-child relationship. I've...
6
by: Jon Hyland | last post by:
Ok, I'm a little rusty on this, it should be a simple problem but I can't figure it out. How can I handle form events in my main code page?? I'm creating a Windows App in C#. Rather than make...
2
by: Josh King | last post by:
I have a windows form that opens up another windows form on top of it. I'd like the newly opened window to call an event on the parent to refresh it's data on the screen, as the new window closes. ...
8
by: CJack | last post by:
hy, I have an mdi application, i create a child form and I want to know when a button is pressed while that child form is loaded. I have this code: private void frmTestBaby_KeyUp(object sender,...
1
by: Earl Teigrob | last post by:
I did a ton of searching to try and find a simple solution to this issue and finally wrote my own, which I am sharing with everyone. In my searching, I did find a very complete and robust solution at...
10
by: Charles Law | last post by:
For some reason, when I click the X to close my MDI parent form, the action appears to be re-directed to one of the MDI child forms, and the parent remains open. I am then unable to close the...
3
by: Opa | last post by:
Hi , I have a form with javasript which launches a popup via the showModalDialog() method. I get the dialog to open, now I am trying to first get a reference to the calling form from the popup...
4
by: raj_genius | last post by:
I hav two queries, whc are as follows: FIRSTLY: is it possible to access the controls(by name) of a parent form(MDI) from its child forms??if yes then how??plzz provide a coded example in VB if...
4
by: Richard Lewis Haggard | last post by:
What is the mechanism by which a child window can notify its parent that it has been clicked on? -- Richard Lewis Haggard www.Haggard-And-Associates.com
1
by: nupuragr82 | last post by:
I have a parent form and on button click I am calling a child page where i have a textbox and a button. On button click of child form I am passing the value of the Textbox to the Textbox in parent...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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: 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
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
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,...
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.