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

Javascript Object expected error when controls are made visible

1 Answer 83 Views
Ajax
This is a migrated thread and some comments may be shown as answers.
mary
Top achievements
Rank 1
mary asked on 07 Oct 2008, 02:12 PM
Hi
I'm haveing a problem with RadComboBox and RadtextBox in an ajax panel (or using the radajaxmanger) with the latest version of the controls.  If the combo box or text box is not visible when the page is first loaded (eg inside a rad grid edit template), a javascript error "Microsoft JScript runtime error: Object expected" error is displayed when the control is made visible.  The combo box will then display disabled. 
This appeared to work fine in previous versions of the controls.  Any idea on what needs to change?

here's is an example page that seems to have the same problem:

<%

@ Page Language="C#" AutoEventWireup="true" CodeFile="Default3.aspx.cs" Inherits="Default3" %>

 

<%

@ Register assembly="Telerik.Web.UI" namespace="Telerik.Web.UI" tagprefix="telerik" %>

 

<!

DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

 

<

html xmlns="http://www.w3.org/1999/xhtml">

 

<

head runat="server">

 

 

<title></title>

 

</

head>

 

<

body>

 

 

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

 

 

<div>

 

 

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

 

 

</telerik:RadScriptManager>

 

 

<telerik:RadAjaxPanel ID="RadAjaxPanel1" runat="server" Height="200px" Width="300px">

 

 

<telerik:radcombobox ID="RadComboBox1" runat="server" Visible="false"

 

 

onselectedindexchanged="RadComboBox1_SelectedIndexChanged">

 

 

<CollapseAnimation Type="OutQuint" Duration="200"></CollapseAnimation>

 

 

</telerik:radcombobox>

 

 

<asp:Button ID="Button1" runat="server" Text="Button" onclick="Button1_Click" />

 

 

<asp:Label ID="Label1" runat="server" Text="Label"></asp:Label>

 

 

</telerik:RadAjaxPanel>

 

 

</div>

 

 

</form>

 

</

body>

 

</

html>


 

using

System;

 

 

 

using

System.Collections.Generic;

 

 

 

using

System.Linq;

 

 

 

using

System.Web;

 

 

 

using

System.Web.UI;

 

 

 

using

System.Web.UI.WebControls;

 

 

 

using

Telerik.Web.UI;

 

 

 

public

partial class Default3 : System.Web.UI.Page

 

 

 

{

 

protected void Page_Load(object sender, EventArgs e)

 

{

RadComboBox1.Items.Add(

new RadComboBoxItem("testing", "1"));

 

}

 

 

protected void RadComboBox1_SelectedIndexChanged(object o, Telerik.Web.UI.RadComboBoxSelectedIndexChangedEventArgs e)

 

{

}

 

protected void Button1_Click(object sender, EventArgs e)

 

{

RadComboBox1.Visible = !RadComboBox1.Visible;

}

}

1 Answer, 1 is accepted

Sort by
0
Daniel
Telerik team
answered on 10 Oct 2008, 11:29 AM
Hello Mary,

I tried to reproduce the error but unfortunately without avail. Please test whether you are experiencing the same behavior with the attached sample website based on your code.

Best regards,
Daniel
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Tags
Ajax
Asked by
mary
Top achievements
Rank 1
Answers by
Daniel
Telerik team
Share this question
or