This is a migrated thread and some comments may be shown as answers.

Passing values from parent To child

4 Answers 297 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
SUBIN
Top achievements
Rank 1
SUBIN asked on 16 Feb 2013, 05:38 AM
Hello ,
I am using Telerik Rad Popup window..While clicking the button insdide popup I can pass values to main page(parent)
  String value = "Subin","Sebastian"
                { ClientScript.RegisterStartupScript(this.GetType(), "closewin", "CloseWin('" + value + "');", true); }
Is there any option to pass values from parent to child
I mean while clicking any button inside Main page(parent ),i wanna pass values to popup window...

4 Answers, 1 is accepted

Sort by
0
SUBIN
Top achievements
Rank 1
answered on 18 Feb 2013, 06:43 AM
Hello ,
I am using Telerik Rad Popup window..While clicking the button insdide popup I can pass values to main page(parent)
  String value = "Subin","Sebastian"
                { ClientScript.RegisterStartupScript(this.GetType(), "closewin", "CloseWin('" + value + "');", true); }
Is there any option to pass values from parent to child
I mean while clicking any button inside Main page(parent ),i wanna pass values to popup window.

please provide a solution asap
0
Princy
Top achievements
Rank 2
answered on 18 Feb 2013, 07:08 AM
Hi,

One suggestion is that you can set the DataKeyNames and pass the value as shown below.
C#:
void RadGrid1_ItemDataBound(object sender, GridItemEventArgs e)
{
        if (e.Item is GridDataItem)
        {
            GridDataItem item = (GridDataItem)e.Item;
            string value = item.GetDataKeyValue("ID").ToString();
            Button img = (Button)item.FindControl("Button1");
           btn.OnClientClick = "OnClientClick(" + value + ");return false";
        }
}
JS:
function OnClientClick(value)
{
        window.radopen("Page.aspx?ID=" +value, null);
 
}

Thanks,
Princy
0
SUBIN
Top achievements
Rank 1
answered on 18 Feb 2013, 09:56 AM
Hellow,
On click am using this code only
  Webform1.VisibleOnPageLoad = true;
then how can i pass value
0
Shinu
Top achievements
Rank 2
answered on 21 Feb 2013, 06:27 AM
Hi,

Setting the VisibleOnPageLoad property causes the RadWindow to appear on each postback. You can access the Button and open RadWindow using the above mentioned approach. Also you can use the server side approach for opening RadWindow as shown below.
C#:
protected void Button1_Click(object sender, EventArgs e)
   {
       string script = "function f(){$find(\"" + RadWindow1.ClientID + "\").show(); Sys.Application.remove_load(f);}Sys.Application.add_load(f);";
       ScriptManager.RegisterStartupScript(this, this.GetType(), "key", script, true);
   }

Thanks,
Shinu
Tags
General Discussions
Asked by
SUBIN
Top achievements
Rank 1
Answers by
SUBIN
Top achievements
Rank 1
Princy
Top achievements
Rank 2
Shinu
Top achievements
Rank 2
Share this question
or