function ShowHideRefreshItems() { var dp = $find("<%= rdpRefresh.ClientID %>"); //var textbox = $find("<%= rntSupportRef.ClientID %>"); if (dp.get_enabled()) dp.disable(); else dp.enable(); }<asp:CheckBox ID="cbRefresh" runat="server" Text="Request a refresh of environment" ValidationGroup="vgEnvironmentUpdate" onclick="ShowHideRefreshItems()" /> <telerik:RadDatePicker ID="rdpRefresh" Skin="Default" runat="server" DateInput-ValidationGroup="vgEnvironmentUpdate" Enabled="false"> <Calendar UseRowHeadersAsSelectors="False" UseColumnHeadersAsSelectors="False" ViewSelectorText="x"> </Calendar> <DatePopupButton ImageUrl="" HoverImageUrl=""></DatePopupButton> <DateInput DisplayDateFormat="dd/MM/yyyy" DateFormat="dd/MM/yyyy" ValidationGroup="vgEnvironmentUpdate"> </DateInput> </telerik:RadDatePicker> var list = $find('<%=RadListBoxRisk1.CLientID %>')alert(list.get_enabled() ) // displays falsevar checkeditems = list.get_checkedItems()for (x =0; x <checkeditems.length ;x ++ ){ checkeditems[x].uncheck() alert(checkeditems[x].get_checked()); // displays true }var list = $find('<%=RadListBoxRiskEffects.CLientID %>')list.set_enabled(true)alert(list.get_enabled() ) // displays truevar checkeditems = list.get_checkedItems()for (x =0; x <checkeditems.length ;x ++ ){ checkeditems[x].uncheck() alert(checkeditems[x].get_checked()); // displays false}list.set_enabled(false)
The page worked fine by itself.. But once I made it a .ascx that is part of a .aspx that is part of a master page I get the error below (when I uncomment that line)..
that radscriptmanager is there in the masterpage
<
telerik:RadScriptManager ID="RadScriptManager1" runat="server" EnablePartialRendering="True"
EnableScriptCombine="False" CompositeScript-ScriptMode="Auto" ScriptMode="Auto"
AsyncPostBackTimeout="360000">
<Scripts>
<asp:ScriptReference Path="~/Shared/script/AjaxLibrary/MicrosoftAjax.js" />
<asp:ScriptReference Path="~/Shared/script/AjaxLibrary/MicrosoftAjaxCore.js" />
<asp:ScriptReference Path="~/Shared/script/jPrototypes.js" />
</Scripts>
<CdnSettings TelerikCdn="Disabled" />
</telerik:RadScriptManager>
but I get this error below.. any ideas? (I should be able to work aroud it but just wondering what is so special about assigning a value to the NumericTextBox.ID)
Microsoft JScript runtime error: 'undefined' is null or not an object
{
var a=this;b.UI.Control.initializeBase(a);a._element=c;c.control=a;var d=a.get_role();d&&c.setAttribute("role",d)}
////Current Amount Hope6
TableCell tcCurrentAmountHope6 = new TableCell();
RadNumericTextBox tbCurrentAmountHope6 = new RadNumericTextBox();
tbCurrentAmountHope6.Type =
NumericType.Currency;
//tbCurrentAmountHope6.ID = "tbCurrentAmountHope6" + level1.Level1 + cc.ftaskId;
tbCurrentAmountHope6.Attributes[
"TaskId"] = cc.ftaskId.ToString();
tbCurrentAmountHope6.Attributes[
"FundType"] = "H6";
tbCurrentAmountHope6.Text = cc.H6ExpCQ.ToString();
tbCurrentAmountHope6.Visible = cc.H6Uses.ToString() ==
"0.00" ? false : true;
tcCurrentAmountHope6.Controls.Add(tbCurrentAmountHope6);
trItem3.Controls.Add(tcCurrentAmountHope6);
if (e.CommandName == "Ejecutar"){/* Some long process */ string msg = "success or error message"; RadAjaxManager1.ResponseScripts.Add("radalert('" + msg + "', 330, 210);"); }<rad:RadWindowManager runat="server" ID="wndManager" Skin="WebBlue" Language="es-CL"> <Windows> <rad:RadWindow ID="wndJerarquia" VisibleStatusbar="false" VisibleTitlebar="false" NavigateUrl="VerJerarquia.aspx" VisibleOnPageLoad="false" runat="server" Modal="true" DestroyOnClose="true" /> </Windows></rad:RadWindowManager> <rad:RadAjaxManager ID="RadAjaxManager1" runat="server"> <AjaxSettings> <rad:AjaxSetting AjaxControlID="gdvProcesos"> <UpdatedControls> <rad:AjaxUpdatedControl ControlID="gdvProcesos" /> </UpdatedControls> </rad:AjaxSetting> </AjaxSettings></rad:RadAjaxManager>| <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server" DefaultLoadingPanelID="RadAjaxLoadingPanel1"> |
| <AjaxSettings> |
| <telerik:AjaxSetting AjaxControlID="myAdminTree"> |
| <UpdatedControls> |
| <telerik:AjaxUpdatedControl ControlID="RadGrid1" LoadingPanelID="RadAjaxLoadingPanel1" /> |
| </UpdatedControls> |
| </telerik:AjaxSetting> |
| <telerik:AjaxSetting AjaxControlID="RadGrid1"> |
| <UpdatedControls> |
| <telerik:AjaxUpdatedControl ControlID="RadGrid1"/> |
| </UpdatedControls> |
| </telerik:AjaxSetting> |
| </AjaxSettings> |
| </telerik:RadAjaxManager> |