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

Radwindow showing javascript error

3 Answers 33 Views
Window
This is a migrated thread and some comments may be shown as answers.
Regeesh Joseph
Top achievements
Rank 1
Regeesh Joseph asked on 23 Jun 2011, 01:05 PM
Hai,

I have a Radwindow like this :

<telerik:RadWindowManager ID="RadWindowManager1" ShowContentDuringLoad="false" VisibleStatusbar="false"
                                                        ReloadOnShow="true" runat="server" Skin="Web20" Style="z-index: 20002" >
                                                        <Windows >
                                                            <telerik:RadWindow ID="RadWindowPopup"
                                                                EnableShadow="true" DestroyOnClose="true" Visible="true"
                                                                Behaviors="Resize, Close, Maximize"
                                                                VisibleOnPageLoad="false" runat="server" Title="Local Item Request" Skin="Web20">
                                                            </telerik:RadWindow>
                                                        </Windows>
                                                       
                                                    </telerik:RadWindowManager>

In Code behind, I have called this radwindow like this :

if (!ClientScript.IsStartupScriptRegistered("popupWindow"))
                     System.Web.UI.ScriptManager.RegisterStartupScript(this.Page, this.Page.GetType(), "popupWindow", "showWindow();", true);

showWindow() javascript is

 

function showWindow() {

 

 

var varMealOrderID = document.getElementById('ctl00_CphMaster_hidMealOrderId').value;

 

 

var oWnd = radopen('FKMS_CTRL_Local_Item_Request.aspx?MealOrderId=' + varMealOrderID + '&popup=true' + '&Mode=NEW', 'RadWindowPopup');

 

oWnd.setSize(1100, 750);

oWnd.moveTo(75, 50);

 

}


This code works fine in my local development computer. But When I hosted in a server, it is showing the following javascript error in the radopen portion of showWindow() method.

Microsoft JScript runtime error: Object doesn't support this property or method

Please help me.

3 Answers, 1 is accepted

Sort by
0
Marin Bratanov
Telerik team
answered on 24 Jun 2011, 11:15 AM
Hi Regeesh,

It seems that you are calling this script after a postback. The most likely cause for the error is that the AJAX enabled-controls (like RadWindow) are not yet loaded on the page when the script is executed. Please examine the following blog post for more information on the matter: http://blogs.telerik.com/supportdept/posts/09-05-05/executing_javascript_function_from_server-side_code.aspx.


Regards,
Marin
the Telerik team

Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.

0
Regeesh Joseph
Top achievements
Rank 1
answered on 27 Jun 2011, 08:15 AM
Hai,

If the AJAX enabled-controls (like RadWindow) are not loaded on the page when the script is executed, then how it was working properly earlier? It was working correctly previously. If I host it to server, it is not working.

Thanks & regards,
Regeesh Joseph
0
Marin Bratanov
Telerik team
answered on 28 Jun 2011, 08:34 AM
Hello Regeesh,

It is possible that it would sometimes work in localhost, since the speeds there are extremely high, after all the request goes back to the same computer without any (network) delay - thus the controls may manage to load before the script gets executed.

  Please note that at the current state of affairs I am mostly guessing as to what your setup is and this assumption may not be correct. Please try adopting the approach from the blog post I linked earlier and see if it helps. If not - I suggest that you open a support ticket and send us a simple, runnable solution that isolates your case so that we can debug it locally and see where the issue stems.


All the best,
Marin
the Telerik team

Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.

Tags
Window
Asked by
Regeesh Joseph
Top achievements
Rank 1
Answers by
Marin Bratanov
Telerik team
Regeesh Joseph
Top achievements
Rank 1
Share this question
or