or
Hello all,
While executing the application i am getting Script Error in user Control Page.What i am doing in my ASPX.Cs page i have used User Control and again in that user control i have used another user control which is opened through Rad Window.Is it correct thing to use user control in an another user control.
script Error : Object Undefined :
actually process ---> aspx.Cs---> usercontrol1---->(Rad window)user control2
unable to find the solution for the last few hours.Suggest me the best way to get over it
Thanks in advance

<html xmlns="http://www.w3.org/1999/xhtml"><head runat="server"> <title></title></head><body> <form id="form1" runat="server"> <telerik:RadScriptManager ID="RadScriptManager1" runat="server"></telerik:RadScriptManager> <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server"></telerik:RadAjaxManager> <div> <asp:PlaceHolder ID="PlaceHolder1" runat="server"></asp:PlaceHolder> </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 RadGrid RadGridNote = null; private int NoteId { get { if (ViewState["Id"] == null) { ViewState["Id"] = 0; } ViewState["Id"] = (int)ViewState["Id"] + 1; return (int)ViewState["Id"]; } } private List<Note> NotesList { get { if (ViewState["NotesList"] == null) { // Initialize list. List<Note> list = new List<Note>(); Note note; note = new Note(); note.NoteId = NoteId; note.NoteText = "This is the first note."; list.Add(note); note = new Note(); note.NoteId = NoteId; note.NoteText = "This is the seconds note."; list.Add(note); ViewState["NotesList"] = list; } return (List<Note>)ViewState["NotesList"]; } set { ViewState["NotesList"] = value; } } override protected void OnInit(EventArgs e) { base.OnInit(e); InitializeGridNote(); } protected void Page_Load(object sender, EventArgs e) { RadAjaxManager1.AjaxSettings.AddAjaxSetting(RadGridNote, RadGridNote); } private void InitializeGridNote() { GridBoundColumn boundColumn; GridButtonColumn buttonColumn; GridEditCommandColumn editCommandColumn; GridHTMLEditorColumn htmlEditorColumn; this.RadGridNote = new RadGrid(); // Set required event handlers. RadGridNote.NeedDataSource += new GridNeedDataSourceEventHandler(RadGridNote_NeedDataSource); RadGridNote.InsertCommand += new GridCommandEventHandler(RadGridNote_InsertCommand); RadGridNote.UpdateCommand += new GridCommandEventHandler(RadGridNote_UpdateCommand); RadGridNote.DeleteCommand += new GridCommandEventHandler(RadGridNote_DeleteCommand); RadGridNote.ID = "RadGridNote"; RadGridNote.AutoGenerateColumns = false; RadGridNote.AllowMultiRowEdit = false; RadGridNote.AllowSorting = true; RadGridNote.Width = Unit.Percentage(100); RadGridNote.ClientSettings.Selecting.AllowRowSelect = true; RadGridNote.MasterTableView.DataKeyNames = new string[] { "NoteId" }; RadGridNote.MasterTableView.DataMember = "Note"; RadGridNote.MasterTableView.EditMode = GridEditMode.InPlace; RadGridNote.MasterTableView.CommandItemDisplay = GridCommandItemDisplay.Top; RadGridNote.MasterTableView.CommandItemSettings.AddNewRecordText = "Add New Note"; // Edit button. editCommandColumn = new GridEditCommandColumn(); RadGridNote.MasterTableView.Columns.Add(editCommandColumn); editCommandColumn.ButtonType = GridButtonColumnType.ImageButton; editCommandColumn.UniqueName = "EditCommandColumn"; editCommandColumn.ItemStyle.Width = Unit.Percentage(10); // Delete button. buttonColumn = new GridButtonColumn(); RadGridNote.MasterTableView.Columns.Add(buttonColumn); buttonColumn.ButtonType = GridButtonColumnType.ImageButton; buttonColumn.UniqueName = "DeleteCommandColumn"; buttonColumn.CommandName = "Delete"; buttonColumn.ItemStyle.Width = Unit.Percentage(5); boundColumn = new GridBoundColumn(); RadGridNote.MasterTableView.Columns.Add(boundColumn); boundColumn.ReadOnly = true; boundColumn.UniqueName = "NoteId"; boundColumn.DataField = "NoteId"; boundColumn.HeaderText = "Id"; boundColumn.ItemStyle.Width = Unit.Percentage(10); htmlEditorColumn = new GridHTMLEditorColumn(); RadGridNote.MasterTableView.Columns.Add(htmlEditorColumn); htmlEditorColumn.UniqueName = "NoteText"; htmlEditorColumn.DataField = "NoteText"; htmlEditorColumn.HeaderText = "Note"; htmlEditorColumn.ItemStyle.Width = Unit.Percentage(75); PlaceHolder1.Controls.Add(RadGridNote); } void RadGridNote_NeedDataSource(object sender, GridNeedDataSourceEventArgs e) { RadGridNote.MasterTableView.DataSource = NotesList; } void RadGridNote_InsertCommand(object sender, GridCommandEventArgs e) { GridEditableItem editedItem = e.Item as GridEditableItem; GridEditManager editManager = editedItem.EditManager; Note note = new Note(); note.NoteId = NoteId; note.NoteText = (editManager.GetColumnEditor("NoteText") as GridHTMLEditorColumnEditor).Editor.Content; NotesList.Add(note); } void RadGridNote_UpdateCommand(object sender, GridCommandEventArgs e) { GridEditableItem editedItem = e.Item as GridEditableItem; GridEditManager editManager = editedItem.EditManager; // Obtain the ID for the contract step. int noteId = int.Parse(editedItem.GetDataKeyValue("NoteId").ToString()); Note foundNote = NotesList.Find(delegate(Note note) { return (note.NoteId == noteId); }); if (foundNote != null) { foundNote.NoteText = (editManager.GetColumnEditor("NoteText") as GridHTMLEditorColumnEditor).Editor.Content; } } void RadGridNote_DeleteCommand(object sender, GridCommandEventArgs e) { GridEditableItem editedItem = e.Item as GridEditableItem; GridEditManager editManager = editedItem.EditManager; // Obtain the ID for the contract step. int noteId = int.Parse(editedItem.GetDataKeyValue("NoteId").ToString()); Note foundNote = NotesList.Find(delegate(Note note) { return (note.NoteId == noteId); }); if (foundNote != null) { NotesList.Remove(foundNote); } } [Serializable] private class Note { public int NoteId { get; set; } public string NoteText { get; set; } }}EnableEmbeddedBaseStylesheet = false;EnableEmbeddedScripts = false;EnableEmbeddedSkins = false;RegisterWithScriptManager = false;var scripts = new List<ScriptReference>();scripts.AddRange(ScriptObjectBuilder.GetScriptReferences(typeof(RadGrid)));scripts.AddRange(ScriptObjectBuilder.GetScriptReferences(typeof(RadTabStrip)));scripts.AddRange(ScriptObjectBuilder.GetScriptReferences(typeof(RadMultiPage)));scripts.AddRange(ScriptObjectBuilder.GetScriptReferences(typeof(RadComboBox)));scripts.AddRange(ScriptObjectBuilder.GetScriptReferences(typeof(RadInputManager)));scripts.AddRange(ScriptObjectBuilder.GetScriptReferences(typeof(RadFilter)));scripts.AddRange(ScriptObjectBuilder.GetScriptReferences(typeof(RadMenu)));scripts.AddRange(ScriptObjectBuilder.GetScriptReferences(typeof(RadContextMenu)));scripts.AddRange(ScriptObjectBuilder.GetScriptReferences(typeof(RadInputControl)));scripts.AddRange(ScriptObjectBuilder.GetScriptReferences(typeof(RadMaskedTextBox)));scripts.AddRange(ScriptObjectBuilder.GetScriptReferences(typeof(RadToolTip)));scripts.AddRange(ScriptObjectBuilder.GetScriptReferences(typeof(RadToolTipManager)));scripts.AddRange(ScriptObjectBuilder.GetScriptReferences(typeof(RadNumericTextBox)));scripts.AddRange(ScriptObjectBuilder.GetScriptReferences(typeof(RadUpload)));scripts.AddRange(ScriptObjectBuilder.GetScriptReferences(typeof(RadAsyncUpload)));scripts.AddRange(ScriptObjectBuilder.GetScriptReferences(typeof(RadTreeView)));scripts.AddRange(ScriptObjectBuilder.GetScriptReferences(typeof(RadTextBox)));scripts.AddRange(ScriptObjectBuilder.GetScriptReferences(typeof(RadCalendar)));scripts.AddRange(ScriptObjectBuilder.GetScriptReferences(typeof(RadDatePicker)));scripts.AddRange(ScriptObjectBuilder.GetScriptReferences(typeof(RadDateTimePicker)));scripts.AddRange(ScriptObjectBuilder.GetScriptReferences(typeof(RadMonthYearPicker)));scripts.AddRange(ScriptObjectBuilder.GetScriptReferences(typeof(RadTimeView)));scripts.AddRange(ScriptObjectBuilder.GetScriptReferences(typeof(RadTimePicker)));scripts.AddRange(ScriptObjectBuilder.GetScriptReferences(typeof(RadDateInput)));scripts.AddRange(ScriptObjectBuilder.GetScriptReferences(typeof(RadScriptManager)));scripts.AddRange(ScriptObjectBuilder.GetScriptReferences(typeof(RadAjaxManager)));scripts.AddRange(ScriptObjectBuilder.GetScriptReferences(typeof(RadToolBar)));scripts.AddRange(ScriptObjectBuilder.GetScriptReferences(typeof(RadDate)));foreach (var script in scripts) RadScriptManager1.Scripts.Add(script);var ctl = new RadNumericTextBox();ctl.ID = "RandomId";ctl.NumberFormat.AllowRounding = false;ctl.NumberFormat.DecimalDigits = 0;ctl.NumberFormat.GroupSeparator = "";ctl.MinValue = 1;ctl.MaxValue = int.MaxValue;ctl.ClientEvents.OnKeyPress = "onKeyPress";ctl.ClientEvents.OnBlur = "onBlur";ctl.Value = 1;ctl.EnableEmbeddedBaseStylesheet = false;ctl.EnableEmbeddedScripts = false;ctl.EnableEmbeddedSkins = false;ctl.RegisterWithScriptManager = false;