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

Pass info to rad window from the server side code

1 Answer 88 Views
Window
This is a migrated thread and some comments may be shown as answers.
Ronnie
Top achievements
Rank 1
Ronnie asked on 11 Sep 2008, 10:19 PM

I have a rad window that calls another aspx page with a control attached to it and I would like to pass info to the control with in that rad window.  Is this possible.  I have tried something like this, but am getting an "Object reference not set to an instacne of an object" error.

cntl_add_note.ascx User Control code:

<table style="width: 575px; height: 175px;">
    <tr
>
        <td
>
            Add Notes Section: <asp:Label ID="lblProjectID" runat="server" Text=""></asp:Label
>
        </td
>
    </tr
>
</table
>

This is the server side code that is calling the rad window:

RadWindow1.NavigateUrl = "~/note.aspx"
RadWindow1.Visible = True
RadWindow1.VisibleOnPageLoad = True
RadWindow1.Left = Unit.Percentage(50)
RadWindow1.Top = Unit.Percentage(50)
RadWindow1.Enabled =
True
RadWindow1.Width = Unit.Pixel(600)
RadWindow1.Height = Unit.Pixel(300)

Dim
lblProjectID As Label = DirectCast(RadWindow1.FindControl("lblProjectID"), Label)
lblProjectID.Text =
"Test"

The 2 lines above are where I tried to insert "Test" into the label on the cntl_add_note.ascx User Control, but got the error.  Is it possible to pass the info to that control?

Thanks




 

1 Answer, 1 is accepted

Sort by
0
Accepted
Georgi Tunev
Telerik team
answered on 12 Sep 2008, 01:27 PM
Hi Ronnie,

RadWindow is basically an IFRAME and like with the IFRAME and / or the browser's popup, the communication between the parent and the content page is done on the client. You can directly read some value on the server (on the content page) only if you pass it in the query string.

My suggestion is to implement the desired logic not by using RadWindow but a standard browser's popup (window.open()). Once it works as expected, the same approach will work with RadWindow as well.



Kind regards,
Georgi Tunev
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Tags
Window
Asked by
Ronnie
Top achievements
Rank 1
Answers by
Georgi Tunev
Telerik team
Share this question
or