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

Microsoft JScript runtime error: Unable to set value of the property 'control': object is null or undefined

8 Answers 897 Views
Window
This is a migrated thread and some comments may be shown as answers.
Nahid
Top achievements
Rank 1
Nahid asked on 09 May 2011, 11:23 AM
Hello, I am Developing a web application by using ASP.NET 3.5, jQuery and RadAjax Telerik Control. I get Error Messages when page Loading. that is :"Microsoft JScript runtime error: Unable to set value of the property 'control': object is null or undefined"

the 1st Error Image: errormsg1.png
and when I click to Open RadWindow then get same Error Message. and could not open radwindow

2nd Image: errormsg2.png 
 

How can I solved this Error. Help me..



Thanks
Nahid

8 Answers, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 09 May 2011, 12:32 PM
Hello Nahid,

I am not quite sure about the scenario that you are trying. Please make sure that you are getting the RadWindow object correctly while opening the window.
Take a look at the following help article for the detailed information on opening the windows.
Opening Windows

Can you elaborate/give code if it doesn't help.


Thanks,
Shinu.
0
Nahid
Top achievements
Rank 1
answered on 09 May 2011, 01:32 PM
Hello Shinu,
Thanks for reply. but Its could not found "RadWindow" and  found error : "Microsoft JScript runtime error: Unable to get value of the property 'setUrl': object is null or undefined"  Show the Image in details...


Thanks
Nahid
0
Marin Bratanov
Telerik team
answered on 10 May 2011, 11:11 AM

Hi Nahid,

This error means that the oWnd object is null. It can be null for a number of reasons, from a typing mistake to a call to the function before the controls are loaded.

The most probable, though, is that the RadWindow is inside an INaming container and the $find() method cannot get a correct reference by just using this ID. Please try the following syntax:

var oWnd = $find("<%= rwMemberAccess.ClientID %>");

which will resolve the final client ID of the control to be used in the JavaScript function.

If this does not help please open a support ticket and send us a simple, fully runnable project that displays this issue so we can debug it locally and pinpoint the cause.


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.

0
Hassan
Top achievements
Rank 2
answered on 02 Dec 2011, 01:07 PM
Hi Nahid,
Please Try this:

Ascx File:
=======

<

form id="form1" runat="server">

<div>

<asp:ImageButton ID="ImageButton1" runat="server" ImageUrl="~/Images/register.Gif"

OnClientClick="openWinContentTemplate(); return false;" />

<telerik:RadScriptManager ID="RadScriptManager1"  Runat="server">

</telerik:RadScriptManager>

</div>

<telerik:RadWindow ID="RadWindow1" runat="server">

<ContentTemplate>

 <%-- Your Content here--%>

<asp:Label ID="Label1" runat="server" Text="Show the RadWindow in aspx file from Ascx"></asp:Label>

 </ContentTemplate>

</telerik:RadWindow>

<script type="text/javascript">

function openWinContentTemplate()

 {

 var ShowRadWindow = $telerik.$('[id$="RadWindow1"]').attr("id");

var MyRadWindow = $find(ShowRadWindow);

 MyRadWindow.show();

}

 </script>

 </form>
Aspx File:(Drag and Drop Ascx file to Aspx Page)
=========

 <uc1:RadWindowControl ID="RadWindowControl1" runat="server" />

 

 

0
Stacy
Top achievements
Rank 1
answered on 09 Jan 2012, 09:40 PM
Trying to use your examples....I get this error

Microsoft JScript runtime error: Unable to get value of the property 'open': object is null or undefined

when trying this code:

<telerik:RadWindowManager ClientIDMode="Static" ID="PasswordWindow" Width="800" Height="157" VisibleStatusbar="false" Behaviors="Close,Move" runat="server" DestroyOnClose="True" Modal="true" >
 <Windows>
        <telerik:RadWindow ID="RadWindow1" runat="server" NavigateUrl="http://www.google.com">
        </telerik:RadWindow>
   </Windows>
</telerik:RadWindowManager>
 
<telerik:RadScriptBlock ID="RadScriptBlock1" runat="server">
 
<script type="text/javascript">
    function OpenPasswordChange() {
               var pwWin = window.radopen(null, "RadWindow1");
    }
</script>
 
</telerik:RadScriptBlock>

0
Stacy
Top achievements
Rank 1
answered on 10 Jan 2012, 03:42 PM
As i said before, the above examples do not work for me
0
Richard
Top achievements
Rank 1
answered on 10 Jan 2012, 03:43 PM
Stacy:

It's pretty hard to diagnose the cause for this error from your limited code snippet. When I create a new project, add the code as you've provided, and run it, using Firefox 9.0.1 and IE. there are no errors.

Can you tell me more about what you're trying to accomplish with the RadWindow? Are you trying to provide a login modal window?

With more info, I can assist you.

Regards,
0
Chue Shee
Top achievements
Rank 1
answered on 12 Jan 2012, 05:31 PM
I was receiving a similar issue and resolved it by reviewing the reference.  Try the example below.
 

function openWindow()
{
     var oWnd = window.radopen(null, "RadWindow1");
     oWnd.SetUrl(oWnd.GetUrl());
}

In reference to: http://demos.telerik.com/aspnet-classic/Window/Examples/DialogReturnValue/DefaultCS.aspx
Tags
Window
Asked by
Nahid
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Nahid
Top achievements
Rank 1
Marin Bratanov
Telerik team
Hassan
Top achievements
Rank 2
Stacy
Top achievements
Rank 1
Richard
Top achievements
Rank 1
Chue Shee
Top achievements
Rank 1
Share this question
or