Calling Child form Event from parent form?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • daffurankan
    New Member
    • Apr 2007
    • 30

    Calling Child form Event from parent form?

    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
  • Frinavale
    Recognized Expert Expert
    • Oct 2006
    • 9749

    #2
    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....th en 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

    Comment

    • daffurankan
      New Member
      • Apr 2007
      • 30

      #3
      thank'x a lot but it ha dhappen in vb.net windows applivation.

      Comment

      • ThatThatGuy
        Recognized Expert Contributor
        • Jul 2009
        • 453

        #4
        Originally posted by daffurankan
        thank'x a lot but it ha dhappen in vb.net windows applivation.
        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....

        Comment

        • Frinavale
          Recognized Expert Expert
          • Oct 2006
          • 9749

          #5
          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

          Comment

          • ThatThatGuy
            Recognized Expert Contributor
            • Jul 2009
            • 453

            #6
            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

            Comment

            • Frinavale
              Recognized Expert Expert
              • Oct 2006
              • 9749

              #7
              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

              Comment

              Working...