Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. Handle frame close event

Handle frame close event

Scheduled Pinned Locked Moved ASP.NET
sysadminquestion
4 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • O Offline
    O Offline
    obalesu
    wrote on last edited by
    #1

    Hi, How can i handle frame close event.Actually i wanted to executed server side code when frame window is closed. I am opening this frame window from InitializeRow event of webgrid as shown below frame1.Attributes["src"] = "../Forms_PDF/" + srcFilePath; Whenever i close this frame window i need execute server side code. how can i do.

    V 1 Reply Last reply
    0
    • O obalesu

      Hi, How can i handle frame close event.Actually i wanted to executed server side code when frame window is closed. I am opening this frame window from InitializeRow event of webgrid as shown below frame1.Attributes["src"] = "../Forms_PDF/" + srcFilePath; Whenever i close this frame window i need execute server side code. how can i do.

      V Offline
      V Offline
      Vasudevan Deepak Kumar
      wrote on last edited by
      #2

      Frame is nothing but a window. How about body's onBeforeUnload or onUnload events for the documents that are loaded within that frame in discussion?

      Vasudevan Deepak Kumar Personal Homepage
      Tech Gossips
      The woods are lovely, dark and deep, But I have promises to keep, And miles to go before I sleep, And miles to go before I sleep!

      O 1 Reply Last reply
      0
      • V Vasudevan Deepak Kumar

        Frame is nothing but a window. How about body's onBeforeUnload or onUnload events for the documents that are loaded within that frame in discussion?

        Vasudevan Deepak Kumar Personal Homepage
        Tech Gossips
        The woods are lovely, dark and deep, But I have promises to keep, And miles to go before I sleep, And miles to go before I sleep!

        O Offline
        O Offline
        obalesu
        wrote on last edited by
        #3

        Hi Vasudevan, Thanks for reply,Actually i tried both the events but this event is triggering multiple time and the scenario is like this we are loading some data in the grid in parent form and on clickcellbutton event of the grid we are opening one document in the frame which will directly go to the print. But this printed document is getting saved in physical location.so on close of the this window(frame) we want to delete this file from the physical location. we already used onbeforeunload of parent window but this event is getting triggered multiple times. The issue is it shouldn't trigger the clickcellbutton event multiple times(it is triggering in load as well as unload). We tried both the events in parent form only as shown below. in parent form frame1.Attributes["src"] = "../Forms_PDF/" + srcFilePath; in javascript of parent form -- function HandleClose() { if( document.getElementById('hdnTemp').value=='Delete') { document.getElementById('btnFileRemove').click();//this 'btnFileRemove' is from frame window.so that we are executing server side code of frame from this parent form onunload event but is triggering twice. } } The thing is we need to execute server side code only when the frame window is closed.how we can achieve this.

        O 1 Reply Last reply
        0
        • O obalesu

          Hi Vasudevan, Thanks for reply,Actually i tried both the events but this event is triggering multiple time and the scenario is like this we are loading some data in the grid in parent form and on clickcellbutton event of the grid we are opening one document in the frame which will directly go to the print. But this printed document is getting saved in physical location.so on close of the this window(frame) we want to delete this file from the physical location. we already used onbeforeunload of parent window but this event is getting triggered multiple times. The issue is it shouldn't trigger the clickcellbutton event multiple times(it is triggering in load as well as unload). We tried both the events in parent form only as shown below. in parent form frame1.Attributes["src"] = "../Forms_PDF/" + srcFilePath; in javascript of parent form -- function HandleClose() { if( document.getElementById('hdnTemp').value=='Delete') { document.getElementById('btnFileRemove').click();//this 'btnFileRemove' is from frame window.so that we are executing server side code of frame from this parent form onunload event but is triggering twice. } } The thing is we need to execute server side code only when the frame window is closed.how we can achieve this.

          O Offline
          O Offline
          obalesu
          wrote on last edited by
          #4

          Hi vasudevan, Can you please send example code for this. Thanks & Regards Obalesu.N

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups