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. Close iframe Div in javascript

Close iframe Div in javascript

Scheduled Pinned Locked Moved ASP.NET
questioncsharpjavascript
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.
  • S Offline
    S Offline
    SatyaKeerthi15
    wrote on last edited by
    #1

    I have an aspx page. In that page I am displaying div when click on link. Div contains iframe and i am assigning url to the frame like below. // Function to Show the Div // function ShowDiv(CtrlName) { document.getElementById('divUserCtrl').style.display = 'inline'; frames['ifrm'].window.location = "CreateProject.aspx?ProjCat=G"; return false; } when click on linkbutton can able to display div and redircting to CreateProject page. But in CreateProject when click on a button i need to close this div. How can I do this in c#. I tried like Page.RegisterStartupScript("Reload", "window.close();"); But no luck :(

    N 1 Reply Last reply
    0
    • S SatyaKeerthi15

      I have an aspx page. In that page I am displaying div when click on link. Div contains iframe and i am assigning url to the frame like below. // Function to Show the Div // function ShowDiv(CtrlName) { document.getElementById('divUserCtrl').style.display = 'inline'; frames['ifrm'].window.location = "CreateProject.aspx?ProjCat=G"; return false; } when click on linkbutton can able to display div and redircting to CreateProject page. But in CreateProject when click on a button i need to close this div. How can I do this in c#. I tried like Page.RegisterStartupScript("Reload", "window.close();"); But no luck :(

      N Offline
      N Offline
      Not Active
      wrote on last edited by
      #2

      First, please remember to format any code you post using the pre tags as explained in the forum guidelines. Second, follow the advise given. This is a cross post and since you have not indicated that will most likely just get ignored, at best. Your experience here will be more gratifying if you learn to follow the rules and listen to advice. You can't close it from c#. You will need to have the page being displayed in the iframe call javascript method to close the containing div.


      I know the language. I've read a book. - _Madmatt

      S 1 Reply Last reply
      0
      • N Not Active

        First, please remember to format any code you post using the pre tags as explained in the forum guidelines. Second, follow the advise given. This is a cross post and since you have not indicated that will most likely just get ignored, at best. Your experience here will be more gratifying if you learn to follow the rules and listen to advice. You can't close it from c#. You will need to have the page being displayed in the iframe call javascript method to close the containing div.


        I know the language. I've read a book. - _Madmatt

        S Offline
        S Offline
        SatyaKeerthi15
        wrote on last edited by
        #3

        Button is in one 2.aspx page and frame in 1.apsx. How can I Close frame in 1.aspx from 2.aspx. My subject itself mentioned close frame in javascript not in c#.

        N 1 Reply Last reply
        0
        • S SatyaKeerthi15

          Button is in one 2.aspx page and frame in 1.apsx. How can I Close frame in 1.aspx from 2.aspx. My subject itself mentioned close frame in javascript not in c#.

          N Offline
          N Offline
          Not Active
          wrote on last edited by
          #4

          SatyaKeerthi15 wrote:

          My subject itself mentioned close frame in javascript not in c#.

          From your original post: "How can I do this in c#. I tried like Page.RegisterStartupScript("Reload", "window.close();"); " How much control do you have over the page being displayed in the frame? Is it your, or are you lining to another site?


          I know the language. I've read a book. - _Madmatt

          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