.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

Find Control of parent webpage from child page under iframe

Posted By:      Posted Date: October 19, 2010    Points: 0   Category :ASP.Net


I  Have a webpage suppose ParentPage.aspx which contains a iframe. Under iframe i am calling another webpage Childpage.aspx . Now i want to access ParentPage controls from ChildPage and change the property of that control.

Can any one suggest me how it is possible ?

Below i am writing a code which i am trying. In this code Page.PreviousPage is always null .

if (Page.PreviousPage != null)
                    AjaxControlToolkit.TabPanel objTab = (AjaxControlToolkit.TabPanel)Page.PreviousPage.FindControl("pnlDataElement");
                    if (objTab != null)
                       objTab.Enabled = true;

View Complete Post

More Related Resource Links

How to Access Parent Page (.aspx) control (IDs) from its child User Control (.ascx)

I have a parent .aspx page that has a asp:panel control in it, and this parent .aspx is also referencing a user control that I registered in that .aspx. Lets just call it usercontrolA.ascx for this post.The user control has a radiobuttonlist itself.Based on a selection from the radiotbuttonlist in the user control, I want to be able to hide the asp:panel in my .aspx (parent) but unfortunately I cant' get it to work:parentPanel.visible = true;  <<< I trried this in usercontrolA.ascx.csBut the user control doesn't know about the panel in the parent .aspxSo do I need to expose that somehow from the parent so that I can access it from the code behind of the child .ascx?  How?

How to access child(.ascx) page control from parent page(.aspx) javascript


I have functionality to select All check boxes on grid rows.

Child User control is having grid with checkbox to select all rows of grid. I want to select individual cell html from each row when I select all rows when checkbox 'select all' is clicked and place it into textbox which is in Parent page.

This textbox can only be in parent page.

So i need to call child(.ascx) page control from parent page(.aspx) using javascript as follows.

function CheckUncheckChildren(event)
        var childChkBoxes = document.getElementById('<%=gvUserDetails.ClientID %>').getElementsByTagName("input");
        var childChkBoxCount = childChkBoxes.length;
        var evtelem = (isIE())?event.srcElement:event.currentTarget;
        if(evtelem.checked == true)
            for(var i = 0; i<childChkBoxCount; i++)

How to Bind a child control with properties of the parent control in Silverlight and WPF?

Dear Experts, I have a usercontrol in Silverlight and I want to enable the update button inside the usercontrol with property defined in the usercontrol. For the proof of concept sake I have defined the usercontrol xaml and the code behind in VB.NETBelow is the XAML and VB.NET Code. ----------------------------------------------------------------------- <UserControl x:Class="SLBAppAssementQuestions.SilverlightControl1"     xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"     xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"     xmlns:d="http://schemas.microsoft.com/expression/blend/2008"     xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"     mc:Ignorable="d"     d:DesignHeight="300" d:DesignWidth="400">     <StackPanel>         <CheckBox x:Name="chkBox1" Margin="10" Checked="chkBox1_Checked" >Checkbox1</CheckBox>         <CheckBox x:Name="chkBox2" Margin="10" Checked="chkBox2_Checked">Checkbox1</CheckBox>         <Button  x:Name="BtnUpdate&q

Adding Control To The Child ASPX Page

While i add a asp.net label control to the existing child page to modify it. It gives an error  "SharePoint Designer cannot render the XSLT in this Data View. Try to undo your changes or re-insert the Data View.Failed setting processor stylesheet : 0x80004005 : Keyword xsl:when may not be used here."  Pl z suggest the solution

Refresh parent page in iframe

Hi all, can I refresh a parent page by his inside iframe?

I want to open a web page (.aspx page,child window from parent window) without titlebar how can we d


Hi All,

i have some special requirement like , i want to open a web page (child page) without a title bar for this i am following the below approach but it is not working, to open child window from parent window i am calling this javascript function to the of href of anchor tag...

function OpenChildWindow()

but the child window is opened with titlebar, but i don`t want any titlebar.

the titlebar property i was used in the above method is not working why?

how can we do this, can anybody help me...


Burepalli V S Rao.

find control in datalist by javascript(Not by Code Behind CS Page or ItemDatabound)


Hello all,

I am facing a problem with javascript.Following is the scenario:

I am working on survey application......

I have taken a datalist in which the question in survey are bound in a label control

now user can change color of the question using color picker

color picker have a popup which is closed when user selects a color and

the color of question will be updated as popup closes

So i have to find label control(in which i bound questions)

in datalist by javascript only (not by Cs page or by itemdatabound event because of color picker popup i can not use cs page)

and update the color of label selected by color picker

I googled and found following code but it show null value

var lbl = document.getElementById('<%= Page.Master.FindControl("ContentPlaceHolder1").FindControl("dList").FindControl("lblQuestion") %>');

when I saw the page source following id is generated for label

and so on


ConfirmButtonExtender and ModalPopupExtender Server Control with Master Page Failed to find element


I am in the process of building a server control that contains a ConfirmButtonExtender. This is my code:

The Master Page:

<%@ Master Language="VB" CodeFile="MasterPage.master.vb" Inherits="CBC_MasterPage" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <asp:ContentPlaceHolder id="head" runat="server">
    <form id="form1" runat="server">
        <asp:ContentPlaceHolder id="ContentPlaceHolder1" runat="server">

Sharing value from child control to parent control.


I am relatively new to this, but here is my problem.

I have a parent and a child control. Within the child control I have a dropdown list. Based on dropdown list's selected value I would like to toggle Visibility of Panel in parent control. For instance if I select Show in child control dropdown list, I need to pass true to parent control to make Panel visible and vice versa. How should I do that. I have read that can be done via the event handling and have seen certain scenarios but I am not clear on that. Please help!


WPF Passing a value from parent to a child 'page' hosted in a frame.



I have - what might look like an obvious question - for me it is a headache.

Some background info:

In a WPF Window, I have placed a frame. A Ribbon button in the WPF window executes NavigationServices as you can see below. Mind there is no navigation History (back/Forward).

    Private Sub rTabToolsRgpSystemAdministrationRbtnPolicyEditor_Click(ByVal sender As ObjectByVal e As System.Windows.RoutedEventArgsHandles rTabToolsRgpSystemAdministrationRbtnPolicyEditor.Click
        InsertNavigationAction("Policy Editor")
        piFrame.NavigationService.Navigate(New System.Uri("piPolicyEditor.xaml"UriKind.Relative))

I am trying to pass a string variable (s

How to close child and parent page and redirect to new page


Hi  All,

  Following is my requirement :

I have 3 asp.net web pages. From the 1st page i am opening showmoadlDialog(2nd page) in which(2nd page) i am storing some value in session(Ineed to do this here only) and checking some count which is coming from database, If count is Zero it will display message but if some value is there and then if i click on Ok button it will redirect to 3rd page. And close the 1st and 2nd Page.

Please help me how to do this ?

When i am clicking on Ok button it is showing some cofirmation message(Do you want to close this window) but this i dont want.

Please help me out if you have some better solution.

This is an urgent requirement for my project.



Calling parent page method from user control


I looked up the  threads about  this. But I couldn't do it...

this is my method in aspx.page:

public  void MesajlariGetir()
        DataSet ds = new DataSet();

        SqlConnection con = new SqlConnection();
        SqlCommand cmd = new SqlCommand("msjlarigetir", con);
        cmd.CommandType = CommandType.StoredProcedure;
        cmd.Parameters.AddWithValue("@Kime", Session["kullaniciadi"].ToString());
        con.ConnectionString = cnnstr;
        SqlDataAdapter da = new SqlDataAdapter(cmd);
        pds.DataSource = ds.Tables[0].AsDataView();
        pds.AllowPaging = true;
        pds.PageSize = 10;
        pds.CurrentPageIndex = CurrentPage;


What is difference in Page Life cycle in general postback and postback due to child control of updat



Since both general postback and postback due  to child control of update panel causes a postback and all events of page are loaded then what is the actual difference between  general postback and postback due to child controls of update panel.

Also, it is said that childern of update panel do a partial postback .Then how it is a partial postback ?? I am seeing that whole page life cycle is  happening even in partial postback ?

Can anyone explain this ?

update value from Child page to parent page


hi all,

I am having 1 parent page associated with master page. From that parent page 1 child window is open. Now i enter some text into textbox & if i click on update button then text should be updated in parent textbox. & child window should be closed.

If i use Parent page without master page then its working fine but if i use Master page ,its not working. I think parent page object is not getting if i use Master page.

Propagate child event to a parent control in a user control

I developed a user control with using a picturebox and a label in .net.  Then I create an instance of the user control in a form. Here I wish to add an click event handler for that user control. I want to use only one click event handler for that control not for every controls (eg: picturebox ,label). Even an user click on a label ,picturebox or the form container, an UserControl_click event will be fired. How can I accomplish this?

GridView Parent Child View with JQuery Effects

I was just checked how to add some more cool effects to the GridView control using JQuery. In this post I will display parent-child data in the GridView control with some help of the wonderful JQuery library.

Let's first populate the GridView control.

GridView control to show master-child or master-slave data, written in c#, asp.net

I previously made a master slave datagrid using Visual Studio 2003 .Net (original article) that would allow users to show data to clients using collapse and expand features. These features however did not carry over to gridview for many users. This tutorial will explaing how to create a collapsable/expandable gridview in frameworks 2.0 and higher
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend