Problem with get values from IFRAME
-
Hi, i have one problem. I create web site in VS.2008 on .NET 3.5. On my parent page i have iframe which source attribute src i populate dinamically in code behind : HtmlControl frame1 = (HtmlControl)this.FindControl("ifrCache"); frame1.Attributes["src"] = "form.aspx?form=" + formID; Iframe source is child page who have input text field. Is there any way to get value of input text fields on parent page from iframe source page?
-
Hi, i have one problem. I create web site in VS.2008 on .NET 3.5. On my parent page i have iframe which source attribute src i populate dinamically in code behind : HtmlControl frame1 = (HtmlControl)this.FindControl("ifrCache"); frame1.Attributes["src"] = "form.aspx?form=" + formID; Iframe source is child page who have input text field. Is there any way to get value of input text fields on parent page from iframe source page?
Yes, you can access the controls on the IFrame page just like you did with this:
c#ivan wrote:
HtmlControl frame1 = (HtmlControl)this.FindControl("ifrCache");
You have to do it on the IFrame Document though, but same idea.
The best way to accelerate a Macintosh is at 9.8m/sec² - Marcus Dolengo
-
Yes, you can access the controls on the IFrame page just like you did with this:
c#ivan wrote:
HtmlControl frame1 = (HtmlControl)this.FindControl("ifrCache");
You have to do it on the IFrame Document though, but same idea.
The best way to accelerate a Macintosh is at 9.8m/sec² - Marcus Dolengo
Another problem is that HtmlControl frame1 = (HtmlControl)this.FindControl("ifrCache"); return null but i add runat=server to ifrCache so i can use it like server control and it works. The same problem still persists. I do not know how to access to controls in iframe? Is it javascript solution? :((