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