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

Can't get RadWindow to work

3 Answers 64 Views
Window
This is a migrated thread and some comments may be shown as answers.
Donald Norris
Top achievements
Rank 1
Donald Norris asked on 04 Feb 2010, 04:16 PM
I used RadWindow in ASP.NET and I am now trying to convert to ASP.NET AJAX and I cannot get it to work. Here is my code:

    <asp:ScriptManager runat="server" ID="scriptManagerCLProxy">
  <Services>
    <asp:ServiceReference
       path="~/WebServices/CheckFileStatus.asmx" />
  </Services>
</asp:ScriptManager>
            <telerik:RadWindowManager ID="RadWindowManager1" runat="server">
            <Windows>
                <telerik:RadWindow
                    id="RadWindow1"
                    runat="server"
                    showcontentduringload="false"
                    width="400px"
                    height="400px"
                    title="Critical Comments"
                    behaviors="Default">
                </telerik:RadWindow>
            </Windows>
            </telerik:RadWindowManager>
<script language="javascript" type="text/javascript">
    function CheckCriticalComments() {
        var oWindow = null;
        var CCFlag = document.getElementById("txtCCFlag").value;
        alert("CCFlag=" + CCFlag);
        if (CCFlag == "Y") {
            CCFlag = "N";
            radopen("CriticalComments.aspx", "RadWindow1");
        }
    }
</script>

All I get is an "object required" error message on the "radopen" statement.

Please help.

Thanks,

3 Answers, 1 is accepted

Sort by
0
Georgi Tunev
Telerik team
answered on 05 Feb 2010, 05:40 AM
Hello Donald,

The code that you posted looks OK. How do you open the window, e.g. how do you call CheckCriticalComments()?

Kind regards,
Georgi Tunev
the Telerik team

Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Follow the status of features or bugs in PITS and vote for them to affect their priority.
0
Donald Norris
Top achievements
Rank 1
answered on 08 Feb 2010, 10:32 PM
 Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs)
  If Not Page.IsPostBack Then
   If DALayer.CritialComments(FileNum) Then
                txtCCFlag.Text = "Y"
   End If
end if
end sub


<body class="newNormal" onload="CheckCriticalComments()" >


I have checked and txtCCFlag.text is "Y" and CCFlag = "Y"

Thanks
0
Georgi Tunev
Telerik team
answered on 09 Feb 2010, 06:41 AM
Hi Donald,

The reason for the problem is that you are calling your script in window.onload. Unlike ASP.NET, in ASP.NET AJAX the ASP.NET AJAX controls (like ours) are loaded on a later stage - in Sys.Application.Init. You can verify that by examining the HTML dump of a page with AJAX controls on it.
What happens in your case is that you call radopen(), but the RadWindowManager is still not fully rendered on the page hence the problem. I would suggest either to call your code with a small timeout, or better - to use the pageLoad() function. This is a native ASP.NET AJAX function and its usage is similiar to the onload event handler. The difference is that pageLoad() will be automatically called only after all ASP.NET AJAX controls are loaded on the page (you need to have ScriptManager / RadScriptManager on the page for this function to work).
More information on the subject is available in the ASP.NET AJAX documentation.


Greetings,
Georgi Tunev
the Telerik team

Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Follow the status of features or bugs in PITS and vote for them to affect their priority.
Tags
Window
Asked by
Donald Norris
Top achievements
Rank 1
Answers by
Georgi Tunev
Telerik team
Donald Norris
Top achievements
Rank 1
Share this question
or