Click here to Skip to main content
15,886,689 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,


I have one Master Page and 2 Content Place Holder in this Page. I have load 2 Iframes in these content Place holder. After that I overright "ContentPlaceRight" in frmRight.aspx and then add one Panel in this contentplaceholder. I want to access this control in my "ContentPlaceLeft" (content page). But it shows an error for "Object reference not to set an object ".Please see the aspx and codebehind below :

ASP.NET
<table>
            <tr>
                <td width="30%">
                    <asp:ContentPlaceHolder id="ContentPlaceLeft" runat="server">    
                        <iframe src="Default.aspx" marginwidth="0" marginheight="0" frameborder="No" noresize scrolling="auto" height="100%"
 
                width="100%"  runat="server" target="_top"></iframe>
                    
                </td>
            
               <td width="70%">        
                 <asp:ContentPlaceHolder id="ContentPlaceRight" runat="server">
                      <iframe src="frmRight.aspx" marginwidth="0" marginheight="0" frameborder="No" noresize scrolling="auto" height="100%" width="100%"  runat="server" target="_top"></iframe>        
                                
               </td> 
            </tr>    
    </table>

______________________________________

C#
Dim contentPage As ContentPlaceHolder = TryCast(Me.Page.Master.FindControl("ContentPlaceRight"), ContentPlaceHolder)

           Dim Panel As Panel = TryCast(contentPage.Parent.FindControl("panelOrg"), Panel)
           Panel.Attributes.Add("style", "display:block")
Posted
Updated 23-Apr-13 22:20pm
v2
Comments
Chinmaya C 24-Apr-13 8:32am    
I believe you can't directly access the control of a page which is in iFrame.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900